Skip to content

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.4-devel…
Browse files Browse the repository at this point in the history
…op daily delivery

Accepted Community Pull Requests:
 - #30950: Allow backend login without redirect (by @aapokiiso)
 - #31247: [MFTF] Refactoring of AdminUpdateSimpleProduct...Tests (asserting product details on Storefront) (by @AnnaAPak)
 - #21857: #21853: Allow mview indexers to use different entity columns. (by @nikunjkotecha)
 - #31208: Changed Newsletter Enabled/Disable config settings by priority, store scope then default scope (by @saphaljha)


Fixed GitHub Issues:
 - #31042: [Issue] Allow backend login without redirect (reported by @m2-assistant[bot]) has been fixed in #30950 by @aapokiiso in 2.4-develop branch
   Related commits:
     1. df20ae1
     2. 62e54bd
     3. 760a4e3
     4. 73ef59b
     5. 217c32c
     6. 6e3b5b0

 - #31248: [Issue] [MFTF] Refactoring of AdminUpdateSimpleProduct...Tests (asserting product details on Storefront) (reported by @m2-assistant[bot]) has been fixed in #31247 by @AnnaAPak in 2.4-develop branch
   Related commits:
     1. 701a96a
     2. 40cf39e
     3. ed00875
     4. 8ae0c79
     5. 791d006
     6. 9366f35

 - #21853: Not possible to use different column name in multiple indexers for subscription (reported by @nikunjkotecha) has been fixed in #21857 by @nikunjkotecha in 2.4-develop branch
   Related commits:
     1. 891198c
     2. 7da4940
     3. b59fc5a
     4. 4035ec0
     5. 320ced7
     6. 0d1ac3a
     7. 6cbf85f
     8. 7c2d2a6
     9. 8388a90
     10. 3f67ed8
     11. 873b814
     12. 392dbf6
     13. ff56be5
     14. e16f2c2
     15. 922e029
     16. 330d595
     17. 4c1094a
     18. 69cee97
     19. 46429a4
     20. 4ad7aae
     21. 8a9b768
     22. db4cf23
     23. 094decc
     24. 910eb41
     25. be3f84b

 - #31188: Newsletter enabled setting is always retrieved from the default scope (reported by @savimar06) has been fixed in #31208 by @saphaljha in 2.4-develop branch
   Related commits:
     1. 18aab3c
     2. 1de30e3
     3. cb4988a
     4. 7889a6f
     5. 21c0bff
     6. 3e1d239
     7. 5dab4fa
     8. d099df9
     9. 1c056ea
     10. f3b63dc
  • Loading branch information
magento-engcom-team authored Jan 24, 2021
2 parents 5fa09cc + 33d322b commit c9242e8
Show file tree
Hide file tree
Showing 14 changed files with 269 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ 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()) {
$requestUri = $this->_url->getUrl('*/*/*', ['_current' => true]);
$requestParts = explode('/', trim($request->getRequestUri(), '/'), 2);
$requestUri = $this->_url->getUrl(array_pop($requestParts));
} elseif ($request) {
$requestUri = $request->getRequestUri();
}
Expand Down
7 changes: 3 additions & 4 deletions app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ public function execute()
}

$requestUrl = $this->getRequest()->getUri();
$backendUrl = $this->getUrl('*');
// redirect according to rewrite rule
if ($requestUrl != $backendUrl) {
return $this->getRedirect($backendUrl);
if (!$requestUrl->isValid()) {
return $this->getRedirect($this->getUrl('*'));
}

return $this->resultPageFactory->create();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductTierPrice300InStock.weight}}" stepKey="fillSimpleProductWeight"/>
<selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductTierPrice300InStock.weightSelect}}" stepKey="selectProductWeight"/>
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" />
<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" />
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/>
<waitForPageLoad stepKey="waitForCategory2"/>
<click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/>
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/>
Expand Down Expand Up @@ -122,23 +122,29 @@
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/>

<!-- Verify customer see updated simple product (from the above step) on the storefront page -->
<amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToProductPage"/>
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/>
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductTierPrice300InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/>
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
<argument name="productUrlKey" value="{{simpleProductTierPrice300InStock.urlKey}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/>

<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage">
<argument name="productName" value="{{simpleProductTierPrice300InStock.name}}"/>
</actionGroup>

<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage">
<argument name="productPrice" value="{{simpleProductTierPrice300InStock.price}}"/>
</actionGroup>

<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku">
<argument name="productSku" value="{{simpleProductTierPrice300InStock.sku}}"/>
</actionGroup>
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/>
<assertEquals stepKey="assertStockAvailableOnProductPage">
<expectedResult type="string">{{simpleProductTierPrice300InStock.storefrontStatus}}</expectedResult>
<actualResult type="variable">productStockAvailableStatus</actualResult>
</assertEquals>
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/>
<assertEquals stepKey="assertOldPriceTextOnProductPage">
<expectedResult type="string">${{simpleProductTierPrice300InStock.price}}</expectedResult>
<actualResult type="variable">productPriceAmount</actualResult>
</assertEquals>

<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/>
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage">
<argument name="productStockStatus" value="{{simpleProductTierPrice300InStock.storefrontStatus}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/>
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/>

<!--Verify customer see updated simple product link on magento storefront page and is searchable by sku -->
<amOnPage url="{{StorefrontProductPage.url(simpleProductTierPrice300InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
<selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice245InStock.status}}" stepKey="selectStockStatusInStock"/>
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice245InStock.weight}}" stepKey="fillSimpleProductWeight"/>
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" />
<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" />
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/>
<waitForPageLoad stepKey="waitForCategory2"/>
<click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/>
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/>
Expand Down Expand Up @@ -102,23 +102,29 @@
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/>

<!-- Verify customer see updated simple product (from the above step) on the storefront page -->
<amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToProductPage"/>
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/>
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice245InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/>
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
<argument name="productUrlKey" value="{{simpleProductRegularPrice245InStock.urlKey}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/>

<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage">
<argument name="productName" value="{{simpleProductRegularPrice245InStock.name}}"/>
</actionGroup>

<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage">
<argument name="productPrice" value="{{simpleProductRegularPrice245InStock.price}}"/>
</actionGroup>

<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage">
<argument name="productSku" value="{{simpleProductRegularPrice245InStock.sku}}"/>
</actionGroup>
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/>
<assertEquals stepKey="assertStockAvailableOnProductPage">
<expectedResult type="string">{{simpleProductRegularPrice245InStock.storefrontStatus}}</expectedResult>
<actualResult type="variable">productStockAvailableStatus</actualResult>
</assertEquals>
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/>
<assertEquals stepKey="assertOldPriceTextOnProductPage">
<expectedResult type="string">${{simpleProductRegularPrice245InStock.price}}</expectedResult>
<actualResult type="variable">productPriceAmount</actualResult>
</assertEquals>

<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/>
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage">
<argument name="productStockStatus" value="{{simpleProductRegularPrice245InStock.storefrontStatus}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/>
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/>

<!--Verify customer see updated simple product link on magento storefront page and is searchable by sku -->
<amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice245InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,29 @@
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/>

<!-- Verify customer see updated simple product (from the above step) on the storefront page -->
<amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToProductPage"/>
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/>
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductRegularPrice32501InStock.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/>
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
<argument name="productUrlKey" value="{{simpleProductRegularPrice32501InStock.urlKey}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/>

<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage">
<argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/>
</actionGroup>

<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage">
<argument name="productPrice" value="{{simpleProductRegularPrice32501InStock.price}}"/>
</actionGroup>

<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku">
<argument name="productSku" value="{{simpleProductRegularPrice32501InStock.sku}}"/>
</actionGroup>
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/>
<assertEquals stepKey="assertStockAvailableOnProductPage">
<expectedResult type="string">{{simpleProductRegularPrice32501InStock.storefrontStatus}}</expectedResult>
<actualResult type="variable">productStockAvailableStatus</actualResult>
</assertEquals>
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/>
<assertEquals stepKey="assertOldPriceTextOnProductPage">
<expectedResult type="string">${{simpleProductRegularPrice32501InStock.price}}</expectedResult>
<actualResult type="variable">productPriceAmount</actualResult>
</assertEquals>

<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/>
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage">
<argument name="productStockStatus" value="{{simpleProductRegularPrice32501InStock.storefrontStatus}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/>
<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"/>
Expand Down
Loading

0 comments on commit c9242e8

Please sign in to comment.