-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6849 from magento-l3/TANGO_PR-05-11-2021_24
TANGO PR 05-11-2021 v24
- Loading branch information
Showing
15 changed files
with
537 additions
and
59 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...Test/Mftf/ActionGroup/StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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="StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup"> | ||
<annotations> | ||
<description> | ||
Assert that the MAP message is present on the product listing in the cart, and What's this? link is clickable and bring up the info popup. | ||
</description> | ||
</annotations> | ||
<!-- Confirm that the MAP message and help link are visible --> | ||
<see selector="{{StorefrontCartMapSection.mapNotice}}" userInput="See price before order confirmation." stepKey="seeMsrpNotice"/> | ||
<see selector="{{StorefrontCartMapSection.mapWhatsThis}}" userInput="What's this?" stepKey="seeMsrpNoticeHelpLink"/> | ||
<!-- Confirm that clicking on the 'What's this?' link shows the help popup --> | ||
<click selector="{{StorefrontCartMapSection.mapWhatsThis}}" stepKey="clickOnWhatsThisLink"/> | ||
<waitForElementVisible selector="{{StorefrontCartMapSection.mapWhatsThisPopup}}" stepKey="waitForTheInfoMessage"/> | ||
<!-- Confirm that clicking on X button closes the popup --> | ||
<click selector="{{StorefrontCartMapSection.mapWhatsThisPopupClose}}" stepKey="clickOnCloseInfoMessage"/> | ||
<waitForElementNotVisible selector="{{StorefrontCartMapSection.mapWhatsThisPopup}}" stepKey="waitForTheInfoMessageToClose"/> | ||
</actionGroup> | ||
</actionGroups> |
17 changes: 17 additions & 0 deletions
17
app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCartMapSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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="StorefrontCartMapSection"> | ||
<element name="mapNotice" type="text" selector=".msrp.notice"/> | ||
<element name="mapWhatsThis" type="text" selector=".msrp .action.help.map"/> | ||
<element name="mapWhatsThisPopup" type="text" selector="//div[@id='map-popup-text-what-this']"/> | ||
<element name="mapWhatsThisPopupClose" type="text" selector=".popup button.action.close"/> | ||
</section> | ||
</sections> |
63 changes: 63 additions & 0 deletions
63
...ode/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyMapMessagePopupOnCartViewPageTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?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="StorefrontVerifyMapMessagePopupOnCartViewPageTest"> | ||
<annotations> | ||
<stories value="Shopping Cart"/> | ||
<features value="Checkout"/> | ||
<title value="Minimum Advertised Price 'What's this?' popup does not displays in cart"/> | ||
<description value="When Minimum Advertised Price (MAP) is enabled and the product has MAP set in Advanced Pricing, click on 'What's this?' at the product listing in the shopping cart must display the popup with the info message."/> | ||
<testCaseId value="MC-41596"/> | ||
<useCaseId value="MC-41494"/> | ||
<severity value="MAJOR"/> | ||
<group value="shoppingCart"/> | ||
<group value="checkout"/> | ||
</annotations> | ||
<before> | ||
<!-- Enable MAP functionality in Magento Instance --> | ||
<createData entity="MsrpEnableMAP" stepKey="enableMAP"/> | ||
<!-- Create product and category --> | ||
<createData entity="_defaultCategory" stepKey="category"/> | ||
<createData entity="SimpleProduct" stepKey="product"> | ||
<requiredEntity createDataKey="category"/> | ||
</createData> | ||
</before> | ||
<after> | ||
<!-- Disable MAP functionality in Magento Instance --> | ||
<createData entity="MsrpDisableMAP" stepKey="disableMAP"/> | ||
<!-- Delete product and category --> | ||
<deleteData createDataKey="product" stepKey="deleteSimpleProduct"/> | ||
<deleteData createDataKey="category" stepKey="deleteCategory"/> | ||
</after> | ||
|
||
<!-- Add MAP to the newly created product Advanced Pricing --> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> | ||
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openAdminProductEditPage"> | ||
<argument name="productId" value="$$product.id$$"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminAddMinimumAdvertisedPriceActionGroup" stepKey="setMapToCreatedProduct"> | ||
<argument name="msrpData" value="MsrpBeforeOrderConfirmation"/> | ||
</actionGroup> | ||
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/> | ||
|
||
<!--Adding the newly created product to shopping cart.--> | ||
<actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPageOnFrontEnd"> | ||
<argument name="categoryUrl" value="$category.custom_attributes[url_key]$"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAddSimpleProductToCartActionGroup" stepKey="addProductToCart"> | ||
<argument name="product" value="$product$"/> | ||
</actionGroup> | ||
|
||
<!-- Navigate to the cart edit page --> | ||
<actionGroup ref="clickViewAndEditCartFromMiniCartActionGroup" stepKey="goToCartViewAndEditPage"/> | ||
|
||
<!-- Check if MAP message and link are present and functioning --> | ||
<actionGroup ref="StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup" stepKey="checkFormMapFunctioning"/> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
...est/Mftf/Test/StorefrontCheckoutMiniCartSubtotalMatchesAfterRemoveProductFromCartTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?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="StorefrontCheckoutMiniCartSubtotalMatchesAfterRemoveProductFromCartTest"> | ||
<annotations> | ||
<features value="Multishipping"/> | ||
<stories value="Multiple Shipping"/> | ||
<title value="Check mini shopping cart Subtotal Price matches with the View Cart subtotal price after remove product from cart"/> | ||
<description value="Verify mini shopping cart Subtotal Price matches with the View Cart subtotal price after remove product from cart"/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MC-42067"/> | ||
<useCaseId value="MC-41924"/> | ||
<group value="Multishipment"/> | ||
</annotations> | ||
<before> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> | ||
<createData entity="SimpleSubCategory" stepKey="createCategory"/> | ||
<createData entity="SimpleProduct" stepKey="createdSimpleProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
<createData entity="Customer_US_UK_DE" stepKey="createCustomerWithMultipleAddresses"/> | ||
</before> | ||
<after> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> | ||
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> | ||
<deleteData createDataKey="createdSimpleProduct" stepKey="deleteCreatedSimpleProduct"/> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
<deleteData createDataKey="createCustomerWithMultipleAddresses" stepKey="deleteCustomer"/> | ||
</after> | ||
<!-- Login to the Storefront as created customer --> | ||
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> | ||
<argument name="Customer" value="$$createCustomerWithMultipleAddresses$$"/> | ||
</actionGroup> | ||
<!-- Open the simple product page --> | ||
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductPage"> | ||
<argument name="product" value="$$createdSimpleProduct$$"/> | ||
</actionGroup> | ||
<!-- Add to Cart three times of the product --> | ||
<waitForPageLoad stepKey="waitForProductPageLoad"/> | ||
<actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> | ||
<argument name="productName" value="$$createdSimpleProduct.name$$"/> | ||
<argument name="productQty" value="3"/> | ||
</actionGroup> | ||
<waitForPageLoad time="120" stepKey="waitForAddToCart"/> | ||
<!-- Go to Cart Summary Section --> | ||
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> | ||
<!-- Check Out with Multiple Addresses --> | ||
<actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/> | ||
<!-- Remove first simple product from cart --> | ||
<actionGroup ref="StorefrontRemoveProductOnCheckoutActionGroup" stepKey="removeFirstProductFromCart"/> | ||
<!-- Go back to the cart --> | ||
<click selector="{{MultishippingSection.back}}" stepKey="backToCart"/> | ||
<!-- Check and verify subtotals at mini cart summary section--> | ||
<waitForPageLoad time="120" stepKey="waitForCartSummaryPageToLoad"/> | ||
<grabTextFrom selector="{{CheckoutCartProductSection.productSubtotalByName($$createdSimpleProduct.name$$)}}" stepKey="grabTextFromProductsSubtotalField"/> | ||
<grabTextFrom selector="{{CheckoutCartSummarySection.subTotal}}" stepKey="grabTextFromCartSubtotalField"/> | ||
<assertEquals message="Subtotals should be equal" stepKey="assertSubtotalsFields"> | ||
<expectedResult type="variable">$grabTextFromProductsSubtotalField</expectedResult> | ||
<actualResult type="variable">$grabTextFromCartSubtotalField</actualResult> | ||
</assertEquals> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...o/Paypal/Test/Mftf/ActionGroup/StorefrontCheckoutSelectPaypalPaymentMethodActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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="StorefrontCheckoutSelectPaypalPaymentMethodActionGroup"> | ||
<annotations> | ||
<description>Select Paypal payment method on onepage checkout</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="paymentMethod" defaultValue="{{StorefrontPaypalCheckoutSection.creditCard}}" type="string"/> | ||
</arguments> | ||
<click selector="{{paymentMethod}}" stepKey="selectPaypalPaymentMethod"/> | ||
<waitForPageLoad stepKey="waitForPaypalFormLoad"/> | ||
<scrollTo selector="{{paymentMethod}}" stepKey="scrollToCreditCardSection"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Sales\Model\Grid; | ||
|
||
use Magento\Framework\App\CacheInterface; | ||
|
||
/** | ||
* Cache for last grid update time. | ||
*/ | ||
class LastUpdateTimeCache | ||
{ | ||
/** | ||
* Prefix for cache key. | ||
*/ | ||
private const CACHE_PREFIX = 'LAST_GRID_UPDATE_TIME'; | ||
|
||
/** | ||
* @var CacheInterface | ||
*/ | ||
private $cache; | ||
|
||
/** | ||
* @param CacheInterface $cache | ||
*/ | ||
public function __construct(CacheInterface $cache) | ||
{ | ||
$this->cache = $cache; | ||
} | ||
|
||
/** | ||
* Save last grid update time. | ||
* | ||
* @param string $gridTableName | ||
* @param string $lastUpdatedAt | ||
* @return void | ||
*/ | ||
public function save(string $gridTableName, string $lastUpdatedAt): void | ||
{ | ||
$this->cache->save( | ||
$lastUpdatedAt, | ||
$this->getCacheKey($gridTableName), | ||
[], | ||
3600 | ||
); | ||
} | ||
|
||
/** | ||
* Get last grid update time. | ||
* | ||
* @param string $gridTableName | ||
* @return string|null | ||
*/ | ||
public function get(string $gridTableName): ?string | ||
{ | ||
$lastUpdatedAt = $this->cache->load($this->getCacheKey($gridTableName)); | ||
|
||
return $lastUpdatedAt ?: null; | ||
} | ||
|
||
/** | ||
* Remove last grid update time. | ||
* | ||
* @param string $gridTableName | ||
* @return void | ||
*/ | ||
public function remove(string $gridTableName): void | ||
{ | ||
$this->cache->remove($this->getCacheKey($gridTableName)); | ||
} | ||
|
||
/** | ||
* Generate cache key. | ||
* | ||
* @param string $gridTableName | ||
* @return string | ||
*/ | ||
private function getCacheKey(string $gridTableName): string | ||
{ | ||
return self::CACHE_PREFIX . ':' . $gridTableName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.