From 0847c794feafd87f2a52fbcdb8282387fa8689e4 Mon Sep 17 00:00:00 2001 From: glo5363 Date: Wed, 24 Nov 2021 19:21:21 +0530 Subject: [PATCH 01/24] AC-872 Catalog product list widget sort order configured in backend does not match in frontend --- app/code/Magento/CatalogWidget/Block/Product/ProductsList.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index 7e6693ce68ef9..9307d798ff707 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -14,6 +14,7 @@ use Magento\Catalog\Model\Product\Visibility; use Magento\Catalog\Model\ResourceModel\Product\Collection; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; +use Magento\Catalog\Model\Product\ProductList\Toolbar as ToolbarModel; use Magento\Catalog\Pricing\Price\FinalPrice; use Magento\CatalogWidget\Model\Rule; use Magento\Framework\App\ActionInterface; @@ -31,7 +32,6 @@ use Magento\Rule\Model\Condition\Sql\Builder as SqlBuilder; use Magento\Widget\Block\BlockInterface; use Magento\Widget\Helper\Conditions; - /** * Catalog Products List widget block * @@ -343,7 +343,7 @@ public function createCollection() */ $collection = $this->_addProductAttributesAndPrices($collection) ->addStoreFilter() - ->addAttributeToSort('entity_id', 'desc') + ->addAttributeToSort('position', 'asc') ->setPageSize($this->getPageSize()) ->setCurPage($this->getRequest()->getParam($this->getData('page_var_name'), 1)); From 8cfa3cffa0d40712bfc00bf45ee8095b2e90cc78 Mon Sep 17 00:00:00 2001 From: glo5363 Date: Wed, 24 Nov 2021 19:23:43 +0530 Subject: [PATCH 02/24] AC-872 Catalog product list widget sort order configured in backend does not match in frontend --- app/code/Magento/CatalogWidget/Block/Product/ProductsList.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index 9307d798ff707..9f90e62e855e3 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -14,7 +14,6 @@ use Magento\Catalog\Model\Product\Visibility; use Magento\Catalog\Model\ResourceModel\Product\Collection; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; -use Magento\Catalog\Model\Product\ProductList\Toolbar as ToolbarModel; use Magento\Catalog\Pricing\Price\FinalPrice; use Magento\CatalogWidget\Model\Rule; use Magento\Framework\App\ActionInterface; From 28ae5c4743ecac5c7208a7bd462988d135bdcf0a Mon Sep 17 00:00:00 2001 From: glo5363 Date: Wed, 24 Nov 2021 20:50:13 +0530 Subject: [PATCH 03/24] changes after tests --- .../Magento/CatalogWidget/Block/Product/ProductsList.php | 7 ++----- .../Test/Unit/Block/Product/ProductsListTest.php | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index 9f90e62e855e3..fd281b67ec3be 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -31,6 +31,7 @@ use Magento\Rule\Model\Condition\Sql\Builder as SqlBuilder; use Magento\Widget\Block\BlockInterface; use Magento\Widget\Helper\Conditions; + /** * Catalog Products List widget block * @@ -74,15 +75,11 @@ class ProductsList extends AbstractProduct implements BlockInterface, IdentityIn protected $httpContext; /** - * Catalog product visibility - * * @var Visibility */ protected $catalogProductVisibility; /** - * Product collection factory - * * @var CollectionFactory */ protected $productCollectionFactory; @@ -337,7 +334,7 @@ public function createCollection() $collection->setVisibility($this->catalogProductVisibility->getVisibleInCatalogIds()); /** - * Change sorting attribute to entity_id because created_at can be the same for products fastly created + * Change sorting attribute to position because created_at can be the same for products fastly created * one by one and sorting by created_at is indeterministic in this case. */ $collection = $this->_addProductAttributesAndPrices($collection) diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php index 87a76ab801a1f..106e40ad98ab9 100644 --- a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php +++ b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php @@ -314,7 +314,7 @@ public function testCreateCollection($pagerEnable, $productsCount, $productsPerP $collection->expects($this->once())->method('addAttributeToSelect')->willReturnSelf(); $collection->expects($this->once())->method('addUrlRewrite')->willReturnSelf(); $collection->expects($this->once())->method('addStoreFilter')->willReturnSelf(); - $collection->expects($this->once())->method('addAttributeToSort')->with('entity_id', 'desc')->willReturnSelf(); + $collection->expects($this->once())->method('addAttributeToSort')->with('position', 'asc')->willReturnSelf(); $collection->expects($this->once())->method('setPageSize')->with($expectedPageSize)->willReturnSelf(); $collection->expects($this->once())->method('setCurPage')->willReturnSelf(); $collection->expects($this->once())->method('distinct')->willReturnSelf(); From d2d473a008a34dd22b488e6137e8ad1a394dfd4d Mon Sep 17 00:00:00 2001 From: Aparna Sreekumar Date: Thu, 25 Nov 2021 17:01:41 +0530 Subject: [PATCH 04/24] BUG#AC-1705-Page Cache is not cleared for the parent product on the child product save --- .../Catalog/Model/Indexer/Product/Price.php | 1 - .../Indexer/Product/Price/AbstractAction.php | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price.php index b703ba82a4052..27a7015f05784 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price.php @@ -66,7 +66,6 @@ public function __construct( public function execute($ids) { $this->_productPriceIndexerRows->execute($ids); - $this->cacheContext->registerEntities(ProductModel::CACHE_TAG, $ids); } /** diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php index 404fd27232b93..ff29d74b8d697 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php @@ -6,6 +6,7 @@ namespace Magento\Catalog\Model\Indexer\Product\Price; +use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Type; use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice; use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\Factory; @@ -20,6 +21,7 @@ use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Indexer\CacheContext; use Magento\Framework\Indexer\DimensionalIndexerInterface; use Magento\Framework\Search\Request\Dimension; use Magento\Framework\Stdlib\DateTime; @@ -61,8 +63,6 @@ abstract class AbstractAction protected $_storeManager; /** - * Currency factory - * * @var CurrencyFactory */ protected $_currencyFactory; @@ -83,8 +83,6 @@ abstract class AbstractAction protected $_catalogProductType; /** - * Indexer price factory - * * @var Factory */ protected $_indexerPriceFactory; @@ -109,6 +107,11 @@ abstract class AbstractAction */ private $tableMaintainer; + /** + * @var CacheContext + */ + private $cacheContext; + /** * @param ScopeConfigInterface $config * @param StoreManagerInterface $storeManager @@ -121,6 +124,7 @@ abstract class AbstractAction * @param TierPrice|null $tierPriceIndexResource * @param DimensionCollectionFactory|null $dimensionCollectionFactory * @param TableMaintainer|null $tableMaintainer + * @param CacheContext|null $cacheContext * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -136,7 +140,8 @@ public function __construct( DefaultPrice $defaultIndexerResource, TierPrice $tierPriceIndexResource = null, DimensionCollectionFactory $dimensionCollectionFactory = null, - TableMaintainer $tableMaintainer = null + TableMaintainer $tableMaintainer = null, + CacheContext $cacheContext = null ) { $this->_config = $config; $this->_storeManager = $storeManager; @@ -156,6 +161,7 @@ public function __construct( $this->tableMaintainer = $tableMaintainer ?? ObjectManager::getInstance()->get( TableMaintainer::class ); + $this->cacheContext = $cacheContext ?? ObjectManager::getInstance()->get(CacheContext::class); } /** @@ -391,6 +397,7 @@ protected function _reindexRows($changedIds = []) if ($changedIds) { $this->deleteIndexData($changedIds); + $this->cacheContext->registerEntities(Product::CACHE_TAG, $changedIds); } $typeIndexers = $this->getTypeIndexers(); From 44af43626da76b72d175c68ef7238f82f53567d2 Mon Sep 17 00:00:00 2001 From: Aparna Sreekumar Date: Mon, 29 Nov 2021 20:34:48 +0530 Subject: [PATCH 05/24] MFTF Test cases added --- ...tPriceWhenChildProductPriceUpdatedTest.xml | 208 ++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml new file mode 100644 index 0000000000000..1e87cfce0399d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml @@ -0,0 +1,208 @@ + + + + + + + + + <description value="Login as admin and check the configurable product price when one child product child product price is updated"/> + <severity value="CRITICAL"/> + <group value="product"/> + </annotations> + <before> + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> + + <!-- Create Default Category --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + + <!-- Create an attribute with two options to be used in the child product --> + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + + <!-- Add the attribute just created to default attribute set --> + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + + <!-- Get the first option of the attribute created --> + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + + <!-- Get the second option of the attribute created --> + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + + <!-- Create Configurable product --> + <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!-- Create a simple product and give it the attribute with the first option --> + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <field key="price">10.00</field> + </createData> + + <!--Create a simple product and give it the attribute with the second option --> + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + <field key="price">20.00</field> + </createData> + + <!-- Create the configurable product --> + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + </createData> + + <!-- Add the first simple product to the configurable product --> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct1"/> + </createData> + + <!-- Add the second simple product to the configurable product --> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct2"/> + </createData> + + <!--Open Index Management Page and Select Index mode "Update by Schedule" --> + <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="schedule" /> + + <!-- Run cron --> + <magentoCron stepKey="runIndexCronJobs" groups="index"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> + + <!-- Wait till cron job runs for schedule updates --> + <wait time="60" stepKey="waitForUpdateStarts"/> + </before> + <after> + <!-- Delete Created Data --> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <!-- Reindex invalidated indices after product attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + </after> + + <!-- Open Product in Store Front Page --> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductInStoreFront"> + <argument name="product" value="$createConfigProduct$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductToLoad"/> + + <!-- Verify category,Configurable product and initial price --> + <actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCategoryInFrontPage"> + <argument name="categoryName" value="$$createCategory.name$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductNameInStoreFront"> + <argument name="productName" value="$$createConfigProduct.name$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeInitialPriceInStoreFront"> + <argument name="productPrice" value="$$createConfigChildProduct1.price$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront"> + <argument name="productSku" value="$$createConfigProduct.sku$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStatusInStoreFront"> + <argument name="productStockStatus" value="In Stock"/> + </actionGroup> + + <!-- Verify First Child Product attribute option is displayed --> + <see selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="seeOption1"/> + + <!-- Select product Attribute option1, option2 and option3 and verify changes in the price --> + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption1"> + <argument name="attributeLabel" value="$$createConfigProductAttribute.default_value$$"/> + <argument name="optionLabel" value="$$getConfigAttributeOption1.label$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeChildProduct1PriceInStoreFront"> + <argument name="productPrice" value="$$createConfigChildProduct1.price$$"/> + </actionGroup> + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption2"> + <argument name="attributeLabel" value="$$createConfigProductAttribute.default_value$$"/> + <argument name="optionLabel" value="$$getConfigAttributeOption2.label$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeChildProduct2PriceInStoreFront"> + <argument name="productPrice" value="$$createConfigChildProduct2.price$$"/> + </actionGroup> + <!-- Open Product Index Page and Filter First Child product --> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="navigateToProductIndex"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProduct"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache"> + <argument name="tags" value="full_page"/> + </actionGroup> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="selectFirstRow"> + <argument name="productId" value="$$createConfigChildProduct1.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageToLoad"/> + + <updateData entity="SimpleProductUpdatePrice90" createDataKey="createConfigChildProduct1" stepKey="updateSimpleProductOne"/> + + <!-- Run cron --> + <magentoCron stepKey="runIndexCronJobs" groups="index"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> + + <!-- Wait till cron job runs for schedule updates --> + <wait time="60" stepKey="waitForUpdateStarts"/> + + <!-- Open Product Store Front Page --> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductInStoreFront1"> + <argument name="product" value="$createConfigProduct$"/> + </actionGroup> + <comment userInput="CommentConfigurableProductTwoOptions is added to preserve the step key for backward compatibility" stepKey="waitForProductToLoad1"/> + + <!-- Verify category,configurable product and updated price --> + <actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCategoryInFrontPage1"> + <argument name="categoryName" value="$$createCategory.name$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductNameInStoreFront1"> + <argument name="productName" value="$$createConfigProduct.name$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeUpdatedProductPriceInStoreFront"> + <argument name="productPrice" value="$$createConfigChildProduct2.price$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront1"> + <argument name="productSku" value="$$createConfigProduct.sku$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStatusInStoreFront1"> + <argument name="productStockStatus" value="In Stock"/> + </actionGroup> + + <!-- Verify product Attribute Option1 is displayed --> + + <see selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="seeOption1AfterUpdate"/> + + <!--Select product Attribute option1 and verify changes in the price --> + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption1AfterUpdate"> + <argument name="attributeLabel" value="$$createConfigProductAttribute.default_value$$"/> + <argument name="optionLabel" value="$$getConfigAttributeOption1.label$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeChildProduct1PriceInStoreFrontAfterUpdate"> + <argument name="productPrice" value="$$createConfigChildProduct1.price$$"/> + </actionGroup> + </test> +</tests> From 21ca5f978fcc4a4cdbc2d6bfeb7b71edb7d45590 Mon Sep 17 00:00:00 2001 From: Aparna Sreekumar <glo80326@adobe.com> Date: Tue, 30 Nov 2021 09:46:59 +0530 Subject: [PATCH 06/24] MFTF test case updated; --- ...nfigurableProductPriceWhenChildProductPriceUpdatedTest.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml index 1e87cfce0399d..806366a7ad57e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml @@ -96,6 +96,9 @@ <wait time="60" stepKey="waitForUpdateStarts"/> </before> <after> + <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> + <!-- Delete Created Data --> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> @@ -193,7 +196,6 @@ </actionGroup> <!-- Verify product Attribute Option1 is displayed --> - <see selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="seeOption1AfterUpdate"/> <!--Select product Attribute option1 and verify changes in the price --> From 72feb0ffb3da3aa28a6f2632a3303200a2a56c02 Mon Sep 17 00:00:00 2001 From: Aparna Sreekumar <glo80326@adobe.com> Date: Thu, 9 Dec 2021 13:25:07 +0530 Subject: [PATCH 07/24] BUG#AC-1248: Test is not compatible with AWS MQ (rabbitmq) service - issue fixed --- .../testsuite/Magento/Framework/MessageQueue/TopologyTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/MessageQueue/TopologyTest.php b/dev/tests/integration/testsuite/Magento/Framework/MessageQueue/TopologyTest.php index 7cbc973fe3066..01d45293ec48c 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/MessageQueue/TopologyTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/MessageQueue/TopologyTest.php @@ -55,7 +55,8 @@ public function testTopologyInstallation(array $expectedConfig, array $bindingCo $this->assertArrayHasKey($name, $this->declaredExchanges); unset( $this->declaredExchanges[$name]['message_stats'], - $this->declaredExchanges[$name]['user_who_performed_action'] + $this->declaredExchanges[$name]['user_who_performed_action'], + $this->declaredExchanges[$name]['policy'] ); $this->assertEquals( From 9e31377c8006371b822074217a82eecc3f175c84 Mon Sep 17 00:00:00 2001 From: Mahesh Singh <glo37161@adobe.com> Date: Sat, 11 Dec 2021 20:14:02 +0530 Subject: [PATCH 08/24] AC-1170 Session size of 276672 exceeded allowed session max size of 256000 --- .../Magento/Framework/Session/SaveHandler.php | 37 +++++++++++++++++-- .../Session/Test/Unit/SaveHandlerTest.php | 2 +- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/Session/SaveHandler.php b/lib/internal/Magento/Framework/Session/SaveHandler.php index 5891b8880b627..6676a25d0802d 100644 --- a/lib/internal/Magento/Framework/Session/SaveHandler.php +++ b/lib/internal/Magento/Framework/Session/SaveHandler.php @@ -6,8 +6,11 @@ namespace Magento\Framework\Session; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\App\State; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\SessionException; +use Magento\Framework\Message\ManagerInterface; use Magento\Framework\Session\Config\ConfigInterface; use Psr\Log\LoggerInterface; @@ -48,25 +51,38 @@ class SaveHandler implements SaveHandlerInterface */ private $sessionMaxSizeConfig; + private ?ManagerInterface $messageManager; + + /** + * @var State|mixed + */ + private $appState; + /** * @param SaveHandlerFactory $saveHandlerFactory * @param ConfigInterface $sessionConfig * @param LoggerInterface $logger * @param SessionMaxSizeConfig $sessionMaxSizeConfigs * @param string $default + * @param ManagerInterface|null $messageManager + * @param State|null $appState */ public function __construct( SaveHandlerFactory $saveHandlerFactory, ConfigInterface $sessionConfig, LoggerInterface $logger, SessionMaxSizeConfig $sessionMaxSizeConfigs, - $default = self::DEFAULT_HANDLER + $default = self::DEFAULT_HANDLER, + ManagerInterface $messageManager = null, + State $appState = null ) { $this->saveHandlerFactory = $saveHandlerFactory; $this->sessionConfig = $sessionConfig; $this->logger = $logger; $this->defaultHandler = $default; $this->sessionMaxSizeConfig = $sessionMaxSizeConfigs; + $this->messageManager = $messageManager ?: ObjectManager::getInstance()->get(ManagerInterface::class); + $this->appState = $appState ?: ObjectManager::getInstance()->get(State::class); } /** @@ -99,7 +115,22 @@ public function close() */ public function read($sessionId) { - return $this->callSafely('read', $sessionId); + $sessionData = $this->callSafely('read', $sessionId); + $sessionMaxSize = $this->sessionMaxSizeConfig->getSessionMaxSize(); + $sessionSize = strlen($sessionData); + + if ($sessionSize !== null && $sessionMaxSize < $sessionSize) { + $sessionData = ''; + if ($this->appState->getAreaCode() == 'frontend') { + $this->messageManager->addErrorMessage( + __( + 'There is an error. Please Contact store administrator.' + ) + ); + } + } + + return $sessionData; } /** @@ -127,7 +158,7 @@ public function write($sessionId, $data) ) ); - return $this->callSafely('write', $sessionId, $this->read($sessionId)); + return $this->callSafely('write', $sessionId, $data); } /** diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php b/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php index bce08a5a3e587..f5a23d2151a21 100644 --- a/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php +++ b/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php @@ -125,7 +125,7 @@ public function testWriteMoreThanSessionMaxSize() ->method('getSessionMaxSize') ->willReturn(1); - $this->saveHandlerAdapterMock->expects($this->once()) + $this->saveHandlerAdapterMock->expects($this->any()) ->method('read') ->with('test_session_id') ->willReturn('test_session_data'); From 25af55e646ec51f2f6cf8070e35a2590924f597d Mon Sep 17 00:00:00 2001 From: Mahesh Singh <glo37161@adobe.com> Date: Mon, 13 Dec 2021 17:21:38 +0530 Subject: [PATCH 09/24] Fix static tests failure and updated request changes --- .../Magento/Framework/Session/SaveHandler.php | 16 +++++++------ .../Session/Test/Unit/SaveHandlerTest.php | 24 ++++++++++++++++--- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/lib/internal/Magento/Framework/Session/SaveHandler.php b/lib/internal/Magento/Framework/Session/SaveHandler.php index 6676a25d0802d..1406891570b7b 100644 --- a/lib/internal/Magento/Framework/Session/SaveHandler.php +++ b/lib/internal/Magento/Framework/Session/SaveHandler.php @@ -6,6 +6,7 @@ namespace Magento\Framework\Session; +use Magento\Framework\App\Area; use Magento\Framework\App\ObjectManager; use Magento\Framework\App\State; use Magento\Framework\Exception\LocalizedException; @@ -51,7 +52,10 @@ class SaveHandler implements SaveHandlerInterface */ private $sessionMaxSizeConfig; - private ?ManagerInterface $messageManager; + /** + * @var ManagerInterface + */ + private $messageManager; /** * @var State|mixed @@ -113,7 +117,7 @@ public function close() * @param string $sessionId * @return string */ - public function read($sessionId) + public function read($sessionId): string { $sessionData = $this->callSafely('read', $sessionId); $sessionMaxSize = $this->sessionMaxSizeConfig->getSessionMaxSize(); @@ -121,11 +125,9 @@ public function read($sessionId) if ($sessionSize !== null && $sessionMaxSize < $sessionSize) { $sessionData = ''; - if ($this->appState->getAreaCode() == 'frontend') { + if ($this->appState->getAreaCode() === Area::AREA_FRONTEND) { $this->messageManager->addErrorMessage( - __( - 'There is an error. Please Contact store administrator.' - ) + __('There is an error. Please Contact store administrator.') ); } } @@ -141,7 +143,7 @@ public function read($sessionId) * @return bool * @throws LocalizedException */ - public function write($sessionId, $data) + public function write($sessionId, $data): bool { $sessionMaxSize = $this->sessionMaxSizeConfig->getSessionMaxSize(); $sessionSize = strlen($data); diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php b/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php index f5a23d2151a21..cf76e15f562a6 100644 --- a/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php +++ b/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php @@ -119,17 +119,35 @@ public function testWriteSessionMaxSizeNull() $this->assertTrue($this->saveHandler->write("test_session_id", "testdata")); } - public function testWriteMoreThanSessionMaxSize() + /** + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function testWriteMoreThanSessionMaxSize(): void { $this->sessionMaxSizeConfigMock->expects($this->once()) ->method('getSessionMaxSize') ->willReturn(1); - $this->saveHandlerAdapterMock->expects($this->any()) + $this->saveHandlerAdapterMock->expects($this->never()) + ->method('read'); + + $this->assertTrue($this->saveHandler->write("test_session_id", "testdata")); + } + + /** + * @return void + */ + public function testReadMoreThanSessionMaxSize(): void + { + $this->sessionMaxSizeConfigMock->expects($this->once()) + ->method('getSessionMaxSize') + ->willReturn(1); + + $this->saveHandlerAdapterMock->expects($this->once()) ->method('read') ->with('test_session_id') ->willReturn('test_session_data'); - $this->assertTrue($this->saveHandler->write("test_session_id", "testdata")); + $this->assertEquals(null, $this->saveHandler->read("test_session_id")); } } From c74e20ef2ced0e3cec17bc9300a55cf51f00e987 Mon Sep 17 00:00:00 2001 From: Mahesh Singh <glo37161@adobe.com> Date: Mon, 13 Dec 2021 20:14:38 +0530 Subject: [PATCH 10/24] AC-1316 Magento 2 Integration Resources Aren't Respected --- app/code/Magento/Catalog/etc/acl.xml | 5 +++-- app/code/Magento/Catalog/etc/webapi.xml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/etc/acl.xml b/app/code/Magento/Catalog/etc/acl.xml index c7c0f1f75872d..16926a1cd8d6e 100644 --- a/app/code/Magento/Catalog/etc/acl.xml +++ b/app/code/Magento/Catalog/etc/acl.xml @@ -12,7 +12,6 @@ <resource id="Magento_Catalog::catalog" title="Catalog" translate="title" sortOrder="30"> <resource id="Magento_Catalog::catalog_inventory" title="Inventory" translate="title" sortOrder="10"> <resource id="Magento_Catalog::products" title="Products" translate="title" sortOrder="10"> - <resource id="Magento_Catalog::update_attributes" title="Update Attributes" translate="title" sortOrder="10" /> <resource id="Magento_Catalog::edit_product_design" title="Edit Product Design" translate="title" sortOrder="20" /> </resource> <resource id="Magento_Catalog::categories" title="Categories" translate="title" sortOrder="20"> @@ -27,7 +26,9 @@ </resource> </resource> <resource id="Magento_Backend::stores_attributes"> - <resource id="Magento_Catalog::attributes_attributes" title="Product" translate="title" sortOrder="30" /> + <resource id="Magento_Catalog::attributes_attributes" title="Product" translate="title" sortOrder="30"> + <resource id="Magento_Catalog::update_attributes" title="Update Attributes" translate="title" sortOrder="10" /> + </resource> <resource id="Magento_Catalog::sets" title="Attribute Set" translate="title" sortOrder="40"/> </resource> </resource> diff --git a/app/code/Magento/Catalog/etc/webapi.xml b/app/code/Magento/Catalog/etc/webapi.xml index 5e799cd9f426d..7c6525079be71 100644 --- a/app/code/Magento/Catalog/etc/webapi.xml +++ b/app/code/Magento/Catalog/etc/webapi.xml @@ -84,7 +84,7 @@ <route url="/V1/products/attributes/:attributeCode" method="PUT"> <service class="Magento\Catalog\Api\ProductAttributeRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Catalog::attributes_attributes" /> + <resource ref="Magento_Catalog::update_attributes" /> </resources> </route> <route url="/V1/products/attributes/:attributeCode" method="DELETE"> From f24b83819293abb5a2c30a40b997b6552e56be3d Mon Sep 17 00:00:00 2001 From: Mahesh Singh <glo37161@adobe.com> Date: Mon, 13 Dec 2021 22:04:56 +0530 Subject: [PATCH 11/24] Fix Static tests failed --- lib/internal/Magento/Framework/Session/SaveHandler.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Session/SaveHandler.php b/lib/internal/Magento/Framework/Session/SaveHandler.php index 1406891570b7b..c2e9527b7f7df 100644 --- a/lib/internal/Magento/Framework/Session/SaveHandler.php +++ b/lib/internal/Magento/Framework/Session/SaveHandler.php @@ -17,6 +17,7 @@ /** * Magento session save handler. + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class SaveHandler implements SaveHandlerInterface { From bdb7a99e90d99b1d96e7a9d86c34a09b33bd2825 Mon Sep 17 00:00:00 2001 From: Mahesh Singh <glo37161@adobe.com> Date: Tue, 14 Dec 2021 14:55:29 +0530 Subject: [PATCH 12/24] AC-1170 updated unit tests --- .../Session/Test/Unit/SaveHandlerTest.php | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php b/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php index cf76e15f562a6..84b0b4de4105f 100644 --- a/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php +++ b/lib/internal/Magento/Framework/Session/Test/Unit/SaveHandlerTest.php @@ -119,31 +119,29 @@ public function testWriteSessionMaxSizeNull() $this->assertTrue($this->saveHandler->write("test_session_id", "testdata")); } - /** - * @throws \Magento\Framework\Exception\LocalizedException - */ public function testWriteMoreThanSessionMaxSize(): void { - $this->sessionMaxSizeConfigMock->expects($this->once()) + $this->sessionMaxSizeConfigMock + ->expects($this->once()) ->method('getSessionMaxSize') ->willReturn(1); - $this->saveHandlerAdapterMock->expects($this->never()) + $this->saveHandlerAdapterMock + ->expects($this->never()) ->method('read'); $this->assertTrue($this->saveHandler->write("test_session_id", "testdata")); } - - /** - * @return void - */ + public function testReadMoreThanSessionMaxSize(): void { - $this->sessionMaxSizeConfigMock->expects($this->once()) + $this->sessionMaxSizeConfigMock + ->expects($this->once()) ->method('getSessionMaxSize') ->willReturn(1); - $this->saveHandlerAdapterMock->expects($this->once()) + $this->saveHandlerAdapterMock + ->expects($this->once()) ->method('read') ->with('test_session_id') ->willReturn('test_session_data'); From 0b0e4df90413c370c4b09d6dfd7a6b1e84068826 Mon Sep 17 00:00:00 2001 From: Aparna Sreekumar <glo80326@adobe.com> Date: Wed, 15 Dec 2021 18:33:24 +0530 Subject: [PATCH 13/24] AC-1286: Accessible label added for New View input --- .../base/web/templates/grid/controls/bookmarks/bookmarks.html | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html index b4524c87e2e62..10864de5ec03a 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html @@ -20,6 +20,7 @@ <div class="action-dropdown-menu-item-edit" visible="customVisible"> <input class="admin__control-text" type="text" data-bind=" + attr: {'aria-label': $t('New View'), value: customLabel, hasFocus: isCustomVisible(), keyboard: { From 05955e8072289056460f602a223f73985bd8bf84 Mon Sep 17 00:00:00 2001 From: Aparna Sreekumar <glo80326@adobe.com> Date: Wed, 15 Dec 2021 18:53:44 +0530 Subject: [PATCH 14/24] AC-1286: Accessible label added for New View input --- .../base/web/templates/grid/controls/bookmarks/bookmarks.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html index 10864de5ec03a..337abdee83b35 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html @@ -20,7 +20,7 @@ <div class="action-dropdown-menu-item-edit" visible="customVisible"> <input class="admin__control-text" type="text" data-bind=" - attr: {'aria-label': $t('New View'), + attr: {'aria-label': $t('New View')}, value: customLabel, hasFocus: isCustomVisible(), keyboard: { From 3037ba97da6a45490c8c6040b5c4c7d3ef8b0235 Mon Sep 17 00:00:00 2001 From: Mahesh Singh <glo37161@adobe.com> Date: Thu, 16 Dec 2021 13:32:59 +0530 Subject: [PATCH 15/24] AC-1316 changes reverted and update acl label --- app/code/Magento/Catalog/etc/acl.xml | 5 ++--- app/code/Magento/Catalog/etc/webapi.xml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/etc/acl.xml b/app/code/Magento/Catalog/etc/acl.xml index 16926a1cd8d6e..46ad4fd4901c6 100644 --- a/app/code/Magento/Catalog/etc/acl.xml +++ b/app/code/Magento/Catalog/etc/acl.xml @@ -12,6 +12,7 @@ <resource id="Magento_Catalog::catalog" title="Catalog" translate="title" sortOrder="30"> <resource id="Magento_Catalog::catalog_inventory" title="Inventory" translate="title" sortOrder="10"> <resource id="Magento_Catalog::products" title="Products" translate="title" sortOrder="10"> + <resource id="Magento_Catalog::update_attributes" title="Mass Attributes Update" translate="title" sortOrder="10" /> <resource id="Magento_Catalog::edit_product_design" title="Edit Product Design" translate="title" sortOrder="20" /> </resource> <resource id="Magento_Catalog::categories" title="Categories" translate="title" sortOrder="20"> @@ -26,9 +27,7 @@ </resource> </resource> <resource id="Magento_Backend::stores_attributes"> - <resource id="Magento_Catalog::attributes_attributes" title="Product" translate="title" sortOrder="30"> - <resource id="Magento_Catalog::update_attributes" title="Update Attributes" translate="title" sortOrder="10" /> - </resource> + <resource id="Magento_Catalog::attributes_attributes" title="Product" translate="title" sortOrder="30"/> <resource id="Magento_Catalog::sets" title="Attribute Set" translate="title" sortOrder="40"/> </resource> </resource> diff --git a/app/code/Magento/Catalog/etc/webapi.xml b/app/code/Magento/Catalog/etc/webapi.xml index 7c6525079be71..5e799cd9f426d 100644 --- a/app/code/Magento/Catalog/etc/webapi.xml +++ b/app/code/Magento/Catalog/etc/webapi.xml @@ -84,7 +84,7 @@ <route url="/V1/products/attributes/:attributeCode" method="PUT"> <service class="Magento\Catalog\Api\ProductAttributeRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Catalog::update_attributes" /> + <resource ref="Magento_Catalog::attributes_attributes" /> </resources> </route> <route url="/V1/products/attributes/:attributeCode" method="DELETE"> From 82b3c6991e79381eb0b34bd3a052aabbc600b20e Mon Sep 17 00:00:00 2001 From: Mahesh Singh <glo37161@adobe.com> Date: Thu, 16 Dec 2021 15:37:43 +0530 Subject: [PATCH 16/24] AC-1316 updated en_US.csv for changed ACL label --- app/code/Magento/Catalog/i18n/en_US.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/i18n/en_US.csv b/app/code/Magento/Catalog/i18n/en_US.csv index 7b9d4baacffe5..65dd35b19488c 100644 --- a/app/code/Magento/Catalog/i18n/en_US.csv +++ b/app/code/Magento/Catalog/i18n/en_US.csv @@ -148,7 +148,7 @@ Quantity,Quantity Edit,Edit "Are you sure?","Are you sure?" "Change Status","Change Status" -"Update Attributes","Update Attributes" +"Mass Attributes Update","Mass Attributes Update" "start typing to search category","start typing to search category" "New Category","New Category" "Images (.gif, .jpg, .png)","Images (.gif, .jpg, .png)" From 18acf98d5dd3ebeb685473f43114d7f736271994 Mon Sep 17 00:00:00 2001 From: Mahesh Singh <glo37161@adobe.com> Date: Thu, 16 Dec 2021 15:43:07 +0530 Subject: [PATCH 17/24] AC-1316 updated acl label --- app/code/Magento/Catalog/etc/acl.xml | 2 +- app/code/Magento/Catalog/i18n/en_US.csv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/etc/acl.xml b/app/code/Magento/Catalog/etc/acl.xml index 46ad4fd4901c6..1f8a331fa3328 100644 --- a/app/code/Magento/Catalog/etc/acl.xml +++ b/app/code/Magento/Catalog/etc/acl.xml @@ -12,7 +12,7 @@ <resource id="Magento_Catalog::catalog" title="Catalog" translate="title" sortOrder="30"> <resource id="Magento_Catalog::catalog_inventory" title="Inventory" translate="title" sortOrder="10"> <resource id="Magento_Catalog::products" title="Products" translate="title" sortOrder="10"> - <resource id="Magento_Catalog::update_attributes" title="Mass Attributes Update" translate="title" sortOrder="10" /> + <resource id="Magento_Catalog::update_attributes" title="Mass Update Attributes" translate="title" sortOrder="10" /> <resource id="Magento_Catalog::edit_product_design" title="Edit Product Design" translate="title" sortOrder="20" /> </resource> <resource id="Magento_Catalog::categories" title="Categories" translate="title" sortOrder="20"> diff --git a/app/code/Magento/Catalog/i18n/en_US.csv b/app/code/Magento/Catalog/i18n/en_US.csv index 65dd35b19488c..d5ba3b75493eb 100644 --- a/app/code/Magento/Catalog/i18n/en_US.csv +++ b/app/code/Magento/Catalog/i18n/en_US.csv @@ -148,7 +148,7 @@ Quantity,Quantity Edit,Edit "Are you sure?","Are you sure?" "Change Status","Change Status" -"Mass Attributes Update","Mass Attributes Update" +"Mass Update Attributes","Mass Update Attributes" "start typing to search category","start typing to search category" "New Category","New Category" "Images (.gif, .jpg, .png)","Images (.gif, .jpg, .png)" From bbd6ca32355bfd6b6ea16f8a2cffeaaa7c709529 Mon Sep 17 00:00:00 2001 From: Lavi Jain <87003041+glo05363@users.noreply.github.com> Date: Fri, 17 Dec 2021 12:55:42 +0530 Subject: [PATCH 18/24] static tests changes static tests changes --- .../Magento/CatalogWidget/Block/Product/ProductsList.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index fd281b67ec3be..3578bfb4587e9 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -43,24 +43,24 @@ class ProductsList extends AbstractProduct implements BlockInterface, IdentityIn /** * Default value for products count that will be shown */ - const DEFAULT_PRODUCTS_COUNT = 10; + public const DEFAULT_PRODUCTS_COUNT = 10; /** * Name of request parameter for page number value * * @deprecated @see $this->getData('page_var_name') */ - const PAGE_VAR_NAME = 'np'; + public const PAGE_VAR_NAME = 'np'; /** * Default value for products per page */ - const DEFAULT_PRODUCTS_PER_PAGE = 5; + public const DEFAULT_PRODUCTS_PER_PAGE = 5; /** * Default value whether show pager or not */ - const DEFAULT_SHOW_PAGER = false; + public const DEFAULT_SHOW_PAGER = false; /** * Instance of pager block From e5da1a761e3fe70a92ccb702de7f3aabdc934e21 Mon Sep 17 00:00:00 2001 From: Mahesh Singh <glo37161@adobe.com> Date: Mon, 20 Dec 2021 13:43:38 +0530 Subject: [PATCH 19/24] AC-1170 Fix backward incompatiblility --- lib/internal/Magento/Framework/Session/SaveHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Session/SaveHandler.php b/lib/internal/Magento/Framework/Session/SaveHandler.php index e45e878cd91bb..1e96dac40f361 100644 --- a/lib/internal/Magento/Framework/Session/SaveHandler.php +++ b/lib/internal/Magento/Framework/Session/SaveHandler.php @@ -146,7 +146,8 @@ public function read($sessionId): string * @return bool * @throws LocalizedException */ - public function write($sessionId, $data): bool + #[\ReturnTypeWillChange] + public function write($sessionId, $data) { $sessionMaxSize = $this->sessionMaxSizeConfig->getSessionMaxSize(); $sessionSize = strlen($data); From 7c852fa3d6a3a419e5f3a51efcbf66f3a591c6ae Mon Sep 17 00:00:00 2001 From: Stanislav Idolov <sidolov@magento.com> Date: Wed, 22 Dec 2021 15:42:49 -0600 Subject: [PATCH 20/24] Revert of AC-872 --- .../Block/Product/ProductsList.php | 20 +++++++++++-------- .../Unit/Block/Product/ProductsListTest.php | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index 3578bfb4587e9..b9be530ae8b53 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -43,24 +43,24 @@ class ProductsList extends AbstractProduct implements BlockInterface, IdentityIn /** * Default value for products count that will be shown */ - public const DEFAULT_PRODUCTS_COUNT = 10; + const DEFAULT_PRODUCTS_COUNT = 10; /** * Name of request parameter for page number value * * @deprecated @see $this->getData('page_var_name') */ - public const PAGE_VAR_NAME = 'np'; + const PAGE_VAR_NAME = 'np'; /** * Default value for products per page */ - public const DEFAULT_PRODUCTS_PER_PAGE = 5; + const DEFAULT_PRODUCTS_PER_PAGE = 5; /** * Default value whether show pager or not */ - public const DEFAULT_SHOW_PAGER = false; + const DEFAULT_SHOW_PAGER = false; /** * Instance of pager block @@ -75,11 +75,15 @@ class ProductsList extends AbstractProduct implements BlockInterface, IdentityIn protected $httpContext; /** + * Catalog product visibility + * * @var Visibility */ protected $catalogProductVisibility; /** + * Product collection factory + * * @var CollectionFactory */ protected $productCollectionFactory; @@ -235,8 +239,8 @@ public function getCacheKeyInfo() */ public function getProductPriceHtml( Product $product, - $priceType = null, - $renderZone = \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST, + $priceType = null, + $renderZone = \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST, array $arguments = [] ) { if (!isset($arguments['zone'])) { @@ -334,12 +338,12 @@ public function createCollection() $collection->setVisibility($this->catalogProductVisibility->getVisibleInCatalogIds()); /** - * Change sorting attribute to position because created_at can be the same for products fastly created + * Change sorting attribute to entity_id because created_at can be the same for products fastly created * one by one and sorting by created_at is indeterministic in this case. */ $collection = $this->_addProductAttributesAndPrices($collection) ->addStoreFilter() - ->addAttributeToSort('position', 'asc') + ->addAttributeToSort('entity_id', 'desc') ->setPageSize($this->getPageSize()) ->setCurPage($this->getRequest()->getParam($this->getData('page_var_name'), 1)); diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php index 106e40ad98ab9..87a76ab801a1f 100644 --- a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php +++ b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php @@ -314,7 +314,7 @@ public function testCreateCollection($pagerEnable, $productsCount, $productsPerP $collection->expects($this->once())->method('addAttributeToSelect')->willReturnSelf(); $collection->expects($this->once())->method('addUrlRewrite')->willReturnSelf(); $collection->expects($this->once())->method('addStoreFilter')->willReturnSelf(); - $collection->expects($this->once())->method('addAttributeToSort')->with('position', 'asc')->willReturnSelf(); + $collection->expects($this->once())->method('addAttributeToSort')->with('entity_id', 'desc')->willReturnSelf(); $collection->expects($this->once())->method('setPageSize')->with($expectedPageSize)->willReturnSelf(); $collection->expects($this->once())->method('setCurPage')->willReturnSelf(); $collection->expects($this->once())->method('distinct')->willReturnSelf(); From 6d7d32b57fdc7893450028e8b0cec9a90dc11d91 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov <sidolov@magento.com> Date: Wed, 22 Dec 2021 15:43:27 -0600 Subject: [PATCH 21/24] Revert of AC-872 --- app/code/Magento/CatalogWidget/Block/Product/ProductsList.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index b9be530ae8b53..7e6693ce68ef9 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -239,8 +239,8 @@ public function getCacheKeyInfo() */ public function getProductPriceHtml( Product $product, - $priceType = null, - $renderZone = \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST, + $priceType = null, + $renderZone = \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST, array $arguments = [] ) { if (!isset($arguments['zone'])) { From 20ab79ca39f5179a56f9597dc32100101781c554 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov <sidolov@magento.com> Date: Wed, 22 Dec 2021 19:34:38 -0600 Subject: [PATCH 22/24] Revert of AC-1705 --- .../Catalog/Model/Indexer/Product/Price.php | 1 + .../Indexer/Product/Price/AbstractAction.php | 29 +++++++------------ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price.php index 27a7015f05784..b703ba82a4052 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price.php @@ -66,6 +66,7 @@ public function __construct( public function execute($ids) { $this->_productPriceIndexerRows->execute($ids); + $this->cacheContext->registerEntities(ProductModel::CACHE_TAG, $ids); } /** diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php index ff29d74b8d697..1cce1f0c1a622 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Model\Indexer\Product\Price; -use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Type; use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice; use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\Factory; @@ -21,7 +20,6 @@ use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\Indexer\CacheContext; use Magento\Framework\Indexer\DimensionalIndexerInterface; use Magento\Framework\Search\Request\Dimension; use Magento\Framework\Stdlib\DateTime; @@ -63,6 +61,8 @@ abstract class AbstractAction protected $_storeManager; /** + * Currency factory + * * @var CurrencyFactory */ protected $_currencyFactory; @@ -83,6 +83,8 @@ abstract class AbstractAction protected $_catalogProductType; /** + * Indexer price factory + * * @var Factory */ protected $_indexerPriceFactory; @@ -107,11 +109,6 @@ abstract class AbstractAction */ private $tableMaintainer; - /** - * @var CacheContext - */ - private $cacheContext; - /** * @param ScopeConfigInterface $config * @param StoreManagerInterface $storeManager @@ -124,7 +121,6 @@ abstract class AbstractAction * @param TierPrice|null $tierPriceIndexResource * @param DimensionCollectionFactory|null $dimensionCollectionFactory * @param TableMaintainer|null $tableMaintainer - * @param CacheContext|null $cacheContext * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -140,8 +136,7 @@ public function __construct( DefaultPrice $defaultIndexerResource, TierPrice $tierPriceIndexResource = null, DimensionCollectionFactory $dimensionCollectionFactory = null, - TableMaintainer $tableMaintainer = null, - CacheContext $cacheContext = null + TableMaintainer $tableMaintainer = null ) { $this->_config = $config; $this->_storeManager = $storeManager; @@ -153,15 +148,14 @@ public function __construct( $this->_defaultIndexerResource = $defaultIndexerResource; $this->_connection = $this->_defaultIndexerResource->getConnection(); $this->tierPriceIndexResource = $tierPriceIndexResource ?? ObjectManager::getInstance()->get( - TierPrice::class - ); + TierPrice::class + ); $this->dimensionCollectionFactory = $dimensionCollectionFactory ?? ObjectManager::getInstance()->get( - DimensionCollectionFactory::class - ); + DimensionCollectionFactory::class + ); $this->tableMaintainer = $tableMaintainer ?? ObjectManager::getInstance()->get( - TableMaintainer::class - ); - $this->cacheContext = $cacheContext ?? ObjectManager::getInstance()->get(CacheContext::class); + TableMaintainer::class + ); } /** @@ -397,7 +391,6 @@ protected function _reindexRows($changedIds = []) if ($changedIds) { $this->deleteIndexData($changedIds); - $this->cacheContext->registerEntities(Product::CACHE_TAG, $changedIds); } $typeIndexers = $this->getTypeIndexers(); From a5caca29174684a55ebd2886f6da7fde4321b131 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov <sidolov@magento.com> Date: Wed, 22 Dec 2021 19:35:16 -0600 Subject: [PATCH 23/24] Revert of AC-1705 --- .../Model/Indexer/Product/Price/AbstractAction.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php index 1cce1f0c1a622..404fd27232b93 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php @@ -148,14 +148,14 @@ public function __construct( $this->_defaultIndexerResource = $defaultIndexerResource; $this->_connection = $this->_defaultIndexerResource->getConnection(); $this->tierPriceIndexResource = $tierPriceIndexResource ?? ObjectManager::getInstance()->get( - TierPrice::class - ); + TierPrice::class + ); $this->dimensionCollectionFactory = $dimensionCollectionFactory ?? ObjectManager::getInstance()->get( - DimensionCollectionFactory::class - ); + DimensionCollectionFactory::class + ); $this->tableMaintainer = $tableMaintainer ?? ObjectManager::getInstance()->get( - TableMaintainer::class - ); + TableMaintainer::class + ); } /** From 82d3848f88d4e66b8d591c515c21f27952e8fe74 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov <sidolov@magento.com> Date: Wed, 22 Dec 2021 21:36:52 -0600 Subject: [PATCH 24/24] Revert of AC-1705 --- ...tPriceWhenChildProductPriceUpdatedTest.xml | 210 ------------------ 1 file changed, 210 deletions(-) delete mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml deleted file mode 100644 index 806366a7ad57e..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest.xml +++ /dev/null @@ -1,210 +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="AdminCheckConfigurableProductPriceWhenChildProductPriceUpdatedTest"> - <annotations> - <stories value="Configurable Product"/> - <title value="Check price of configurable product when one child product price is updated"/> - <description value="Login as admin and check the configurable product price when one child product child product price is updated"/> - <severity value="CRITICAL"/> - <group value="product"/> - </annotations> - <before> - <!-- Login as Admin --> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> - - <!-- Create Default Category --> - <createData entity="_defaultCategory" stepKey="createCategory"/> - - <!-- Create an attribute with two options to be used in the child product --> - <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> - <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </createData> - <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </createData> - - <!-- Add the attribute just created to default attribute set --> - <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </createData> - - <!-- Get the first option of the attribute created --> - <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </getData> - - <!-- Get the second option of the attribute created --> - <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </getData> - - <!-- Create Configurable product --> - <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> - <requiredEntity createDataKey="createCategory"/> - </createData> - - <!-- Create a simple product and give it the attribute with the first option --> - <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption1"/> - <field key="price">10.00</field> - </createData> - - <!--Create a simple product and give it the attribute with the second option --> - <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption2"/> - <field key="price">20.00</field> - </createData> - - <!-- Create the configurable product --> - <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> - <requiredEntity createDataKey="createConfigProduct"/> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption1"/> - <requiredEntity createDataKey="getConfigAttributeOption2"/> - </createData> - - <!-- Add the first simple product to the configurable product --> - <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> - <requiredEntity createDataKey="createConfigProduct"/> - <requiredEntity createDataKey="createConfigChildProduct1"/> - </createData> - - <!-- Add the second simple product to the configurable product --> - <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> - <requiredEntity createDataKey="createConfigProduct"/> - <requiredEntity createDataKey="createConfigChildProduct2"/> - </createData> - - <!--Open Index Management Page and Select Index mode "Update by Schedule" --> - <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="schedule" /> - - <!-- Run cron --> - <magentoCron stepKey="runIndexCronJobs" groups="index"/> - <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> - - <!-- Wait till cron job runs for schedule updates --> - <wait time="60" stepKey="waitForUpdateStarts"/> - </before> - <after> - <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> - <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> - - <!-- Delete Created Data --> - <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> - <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> - <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - - <!-- Reindex invalidated indices after product attribute has been created/deleted --> - <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - </after> - - <!-- Open Product in Store Front Page --> - <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductInStoreFront"> - <argument name="product" value="$createConfigProduct$"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductToLoad"/> - - <!-- Verify category,Configurable product and initial price --> - <actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCategoryInFrontPage"> - <argument name="categoryName" value="$$createCategory.name$$"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductNameInStoreFront"> - <argument name="productName" value="$$createConfigProduct.name$$"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeInitialPriceInStoreFront"> - <argument name="productPrice" value="$$createConfigChildProduct1.price$$"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront"> - <argument name="productSku" value="$$createConfigProduct.sku$$"/> - </actionGroup> - <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStatusInStoreFront"> - <argument name="productStockStatus" value="In Stock"/> - </actionGroup> - - <!-- Verify First Child Product attribute option is displayed --> - <see selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="seeOption1"/> - - <!-- Select product Attribute option1, option2 and option3 and verify changes in the price --> - <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption1"> - <argument name="attributeLabel" value="$$createConfigProductAttribute.default_value$$"/> - <argument name="optionLabel" value="$$getConfigAttributeOption1.label$$"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeChildProduct1PriceInStoreFront"> - <argument name="productPrice" value="$$createConfigChildProduct1.price$$"/> - </actionGroup> - <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption2"> - <argument name="attributeLabel" value="$$createConfigProductAttribute.default_value$$"/> - <argument name="optionLabel" value="$$getConfigAttributeOption2.label$$"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeChildProduct2PriceInStoreFront"> - <argument name="productPrice" value="$$createConfigChildProduct2.price$$"/> - </actionGroup> - <!-- Open Product Index Page and Filter First Child product --> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="navigateToProductIndex"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProduct"/> - <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache"> - <argument name="tags" value="full_page"/> - </actionGroup> - <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="selectFirstRow"> - <argument name="productId" value="$$createConfigChildProduct1.id$$"/> - </actionGroup> - <waitForPageLoad stepKey="waitForProductPageToLoad"/> - - <updateData entity="SimpleProductUpdatePrice90" createDataKey="createConfigChildProduct1" stepKey="updateSimpleProductOne"/> - - <!-- Run cron --> - <magentoCron stepKey="runIndexCronJobs" groups="index"/> - <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> - - <!-- Wait till cron job runs for schedule updates --> - <wait time="60" stepKey="waitForUpdateStarts"/> - - <!-- Open Product Store Front Page --> - <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductInStoreFront1"> - <argument name="product" value="$createConfigProduct$"/> - </actionGroup> - <comment userInput="CommentConfigurableProductTwoOptions is added to preserve the step key for backward compatibility" stepKey="waitForProductToLoad1"/> - - <!-- Verify category,configurable product and updated price --> - <actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCategoryInFrontPage1"> - <argument name="categoryName" value="$$createCategory.name$$"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductNameInStoreFront1"> - <argument name="productName" value="$$createConfigProduct.name$$"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeUpdatedProductPriceInStoreFront"> - <argument name="productPrice" value="$$createConfigChildProduct2.price$$"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront1"> - <argument name="productSku" value="$$createConfigProduct.sku$$"/> - </actionGroup> - <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStatusInStoreFront1"> - <argument name="productStockStatus" value="In Stock"/> - </actionGroup> - - <!-- Verify product Attribute Option1 is displayed --> - <see selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="seeOption1AfterUpdate"/> - - <!--Select product Attribute option1 and verify changes in the price --> - <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption1AfterUpdate"> - <argument name="attributeLabel" value="$$createConfigProductAttribute.default_value$$"/> - <argument name="optionLabel" value="$$getConfigAttributeOption1.label$$"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeChildProduct1PriceInStoreFrontAfterUpdate"> - <argument name="productPrice" value="$$createConfigChildProduct1.price$$"/> - </actionGroup> - </test> -</tests>