Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.4-develop' into 2.4-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtuvn committed Apr 29, 2020
2 parents 0e84ed4 + bb7e08f commit 63550be
Show file tree
Hide file tree
Showing 56 changed files with 504 additions and 330 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="deleteBackup">
<actionGroup name="AdminBackupDeleteActionGroup">
<annotations>
<description>Deletes a Backup using provided Backup Entity.</description>
</annotations>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminBackupIndexPageOpenActionGroup">
<amOnPage url="{{AdminBackupIndexPage.url}}" stepKey="navigateToBackupIndexPage"/>
<waitForPageLoad stepKey="waitForBackupIndexPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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="deleteBackup" extends="AdminBackupDeleteActionGroup" deprecated="Use DeleteBackupActionGroup"/>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="BackupIndexPage" url="/backup/index/" area="admin" module="Magento_Backup">
<page name="AdminBackupIndexPage" url="/backup/index/" area="admin" module="Magento_Backup">
<section name="AdminMainActionsSection"/>
<section name="AdminGridTableSection"/>
<section name="AdminCreateBackupFormSection"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

<!--Go to backup index page-->
<amOnPage url="{{BackupIndexPage.url}}" stepKey="goToBackupPage"/>
<waitForPageLoad stepKey="waitForBackupPage"/>
<actionGroup ref="AdminBackupIndexPageOpenActionGroup" stepKey="navigateToBackupPage"/>

<!--Create system backup-->
<actionGroup ref="CreateSystemBackupActionGroup" stepKey="createSystemBackup"/>
Expand All @@ -39,17 +38,17 @@
<actionGroup ref="CreateDatabaseBackupActionGroup" stepKey="createDatabaseBackup"/>

<!--Delete system backup-->
<actionGroup ref="deleteBackup" stepKey="deleteSystemBackup">
<actionGroup ref="AdminBackupDeleteActionGroup" stepKey="deleteSystemBackup">
<argument name="backup" value="SystemBackup"/>
</actionGroup>

<!--Delete database/media backup-->
<actionGroup ref="deleteBackup" stepKey="deleteMediaBackup">
<actionGroup ref="AdminBackupDeleteActionGroup" stepKey="deleteMediaBackup">
<argument name="backup" value="MediaBackup"/>
</actionGroup>

<!--Delete database backup-->
<actionGroup ref="deleteBackup" stepKey="deleteDatabaseBackup">
<actionGroup ref="AdminBackupDeleteActionGroup" stepKey="deleteDatabaseBackup">
<argument name="backup" value="DatabaseBackup"/>
</actionGroup>

Expand Down
5 changes: 2 additions & 3 deletions app/code/Magento/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
const STORE_ID = 'store_id';

/**
* @var string
* @var string|bool
*/
protected $_cacheTag = self::CACHE_TAG;
protected $_cacheTag = false;

/**
* @var string
Expand Down Expand Up @@ -878,7 +878,6 @@ public function getAttributes($groupId = null, $skipSuper = false)
*/
public function beforeSave()
{
$this->cleanCache();
$this->setTypeHasOptions(false);
$this->setTypeHasRequiredOptions(false);
$this->setHasOptions(false);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<see selector="{{StorefrontMinicartSection.productPriceByName($$createProduct1.name$$)}}" userInput="$$createProduct1.price$$" stepKey="seeCorrectProductPrice1"/>

<!-- Assert that the rule isn't present on the Checkout page -->
<click selector="{{StorefrontMiniCartSection.goToCheckout}}" stepKey="goToCheckout1"/>
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout1"/>
<conditionalClick selector="{{CheckoutCartSummarySection.expandShoppingCartSummary}}" dependentSelector="{{CheckoutCartSummarySection.expandShoppingCartSummary}}" visible="true" stepKey="expandShoppingCartSummary1"/>
<see selector="{{CheckoutCartProductSection.ProductRegularPriceByName($$createProduct1.name$$)}}" userInput="$$createProduct1.price$$" stepKey="seeCorrectProductPriceOnCheckout1"/>
</test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<element name="itemDiscount" type="text" selector="//tr[@class='totals']//td[@class='amount']/span"/>
<element name="subtotal" type="text" selector="//tr[@class='totals sub']//td[@class='amount']/span"/>
<element name="emptyCart" type="text" selector=".counter.qty.empty"/>
<element name="emptyMiniCart" type="text" selector="//div[@class='minicart-wrapper']//span[@class='counter qty empty']/../.."/>
<element name="minicartContent" type="block" selector="#minicart-content-wrapper"/>
<element name="messageEmptyCart" type="text" selector="//*[@id='minicart-content-wrapper']//*[contains(@class,'subtitle empty')]"/>
<element name="visibleItemsCountText" type="text" selector="//div[@class='items-total']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

<!-- Verify mini cart is empty -->
<actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="assertEmptryCart">
<argument name="selector" value="{{StorefrontMiniCartSection.emptyMiniCart}}"/>
<argument name="selector" value="{{StorefrontMinicartSection.emptyMiniCart}}"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert Empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Register customer after checkout -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

<!--Place order -->
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Register customer after checkout -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</actionGroup>

<!-- Check cart -->
<click selector="{{StorefrontMiniCartSection.show}}" stepKey="clickMiniCart2"/>
<dontSeeElement selector="{{StorefrontMiniCartSection.quantity}}" stepKey="dontSeeCartItem"/>
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickMiniCart2"/>
<dontSeeElement selector="{{StorefrontMinicartSection.quantity}}" stepKey="dontSeeCartItem"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/>

<!-- Login to Admin Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
30 changes: 29 additions & 1 deletion app/code/Magento/Config/App/Config/Type/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use Magento\Store\Model\Config\Processor\Fallback;
use Magento\Framework\Encryption\Encryptor;
use Magento\Store\Model\ScopeInterface as StoreScope;
use Magento\Framework\App\Cache\StateInterface;
use Magento\Framework\App\Cache\Type\Config;

/**
* System configuration type
Expand Down Expand Up @@ -98,6 +100,12 @@ class System implements ConfigTypeInterface
private $lockQuery;

/**
* @var StateInterface
*/
private $cacheState;

/**
* System constructor.
* @param ConfigSourceInterface $source
* @param PostProcessorInterface $postProcessor
* @param Fallback $fallback
Expand All @@ -110,6 +118,7 @@ class System implements ConfigTypeInterface
* @param Encryptor|null $encryptor
* @param LockManagerInterface|null $locker
* @param LockGuardedCacheLoader|null $lockQuery
* @param StateInterface|null $cacheState
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
Expand All @@ -125,7 +134,8 @@ public function __construct(
Reader $reader = null,
Encryptor $encryptor = null,
LockManagerInterface $locker = null,
LockGuardedCacheLoader $lockQuery = null
LockGuardedCacheLoader $lockQuery = null,
StateInterface $cacheState = null
) {
$this->postProcessor = $postProcessor;
$this->cache = $cache;
Expand All @@ -136,6 +146,8 @@ public function __construct(
?: ObjectManager::getInstance()->get(Encryptor::class);
$this->lockQuery = $lockQuery
?: ObjectManager::getInstance()->get(LockGuardedCacheLoader::class);
$this->cacheState = $cacheState
?: ObjectManager::getInstance()->get(StateInterface::class);
}

/**
Expand Down Expand Up @@ -220,6 +232,10 @@ private function getWithParts($path)
*/
private function loadAllData()
{
if (!$this->cacheState->isEnabled(Config::TYPE_IDENTIFIER)) {
return $this->readData();
}

$loadAction = function () {
$cachedData = $this->cache->load($this->configType);
$data = false;
Expand All @@ -245,6 +261,10 @@ private function loadAllData()
*/
private function loadDefaultScopeData($scopeType)
{
if (!$this->cacheState->isEnabled(Config::TYPE_IDENTIFIER)) {
return $this->readData();
}

$loadAction = function () use ($scopeType) {
$cachedData = $this->cache->load($this->configType . '_' . $scopeType);
$scopeData = false;
Expand All @@ -271,6 +291,10 @@ private function loadDefaultScopeData($scopeType)
*/
private function loadScopeData($scopeType, $scopeId)
{
if (!$this->cacheState->isEnabled(Config::TYPE_IDENTIFIER)) {
return $this->readData();
}

$loadAction = function () use ($scopeType, $scopeId) {
$cachedData = $this->cache->load($this->configType . '_' . $scopeType . '_' . $scopeId);
$scopeData = false;
Expand Down Expand Up @@ -393,6 +417,10 @@ public function clean()
$this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [self::CACHE_TAG]);
};

if (!$this->cacheState->isEnabled(Config::TYPE_IDENTIFIER)) {
return $cleanAction();
}

$this->lockQuery->lockedCleanData(
self::$lockName,
$cleanAction
Expand Down
2 changes: 0 additions & 2 deletions app/code/Magento/Config/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@
<virtualType name="systemConfigQueryLocker" type="Magento\Framework\Cache\LockGuardedCacheLoader">
<arguments>
<argument name="locker" xsi:type="object">Magento\Framework\Lock\Backend\Cache</argument>
<argument name="lockTimeout" xsi:type="number">42000</argument>
<argument name="delayTimeout" xsi:type="number">100</argument>
</arguments>
</virtualType>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminFillCookieLifetimeActionGroup">
<annotations>
<description>Fills the cookie lifetime field with sample data.</description>
</annotations>
<arguments>
<argument name="cookieLifetime" type="string"/>
</arguments>
<fillField selector="{{AdminDefaultCookieSettingsSection.DefaultCookieLifetime}}" userInput="{{cookieLifetime}}" stepKey="fillFieldCookieLifetime"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminNavigateToDefaultCookieSettingsActionGroup">
<amOnPage url="{{AdminConfigurationDefaultCookieSettingsPage.url}}" stepKey="navigateToDefaultCookieSettings"/>
<waitForPageLoad stepKey="waitForWebConfigurationPageLoad"/>
<scrollTo selector="{{AdminDefaultCookieSettingsSection.DefaultCookieSettingsTab}}" x="-150" y="-150" stepKey="scrollToDefaultCookieSettingsSection"/>
<conditionalClick stepKey="expandDefaultCookieSettingsTab" selector="{{AdminDefaultCookieSettingsSection.DefaultCookieSettingsTab}}" dependentSelector="{{AdminDefaultCookieSettingsSection.DefaultCookieLifetime}}" visible="false"/>
<waitForElementVisible selector="{{AdminDefaultCookieSettingsSection.DefaultCookieSettingsTab}}" stepKey="waitForElementsAppeared"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminConfigurationDefaultCookieSettingsPage" url="admin/system_config/edit/section/web/" module="Cookie" area="admin">
<section name="AdminDefaultCookieSettingsSection"/>
</page>
</pages>
Loading

0 comments on commit 63550be

Please sign in to comment.