Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.4-develop' into bugfix/wildcar…
Browse files Browse the repository at this point in the history
…d-section-reload-broken
  • Loading branch information
Greg Harvell committed Sep 8, 2020
2 parents 3b397e3 + 1c9ba3e commit 6f9a274
Show file tree
Hide file tree
Showing 615 changed files with 11,368 additions and 3,518 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminCheckAnalyticsTrackingTest">
<annotations>
<stories value="AdminAnalytics Check Tracking."/>
<title value="AdminAnalytics Check Tracking."/>
<description value="AdminAnalytics Check Tracking."/>
<severity value="MINOR"/>
<testCaseId value="MC-36869"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
<magentoCLI command="config:set admin/usage/enabled 1" stepKey="enableAdminUsageTracking"/>
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
<argument name="tags" value="config full_page"/>
</actionGroup>
<reloadPage stepKey="pageReload"/>
</before>
<after>
<magentoCLI command="config:set admin/usage/enabled 0" stepKey="disableAdminUsageTracking"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>

<waitForPageLoad stepKey="waitForPageReloaded"/>
<seeInPageSource html="var adminAnalyticsMetadata =" stepKey="seeInPageSource"/>
</test>
</tests>
19 changes: 19 additions & 0 deletions app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,24 @@
<value id="adobedtm" type="host">assets.adobedtm.com</value>
</values>
</policy>
<policy id="img-src">
<values>
<value id="adobedtm" type="host">assets.adobedtm.com</value>
<value id="omtrdc" type="host">amcglobal.sc.omtrdc.net</value>
<value id="dpmdemdex" type="host">dpm.demdex.net</value>
<value id="everesttech" type="host">cm.everesttech.net</value>
</values>
</policy>
<policy id="connect-src">
<values>
<value id="dpmdemdex" type="host">dpm.demdex.net</value>
<value id="omtrdc" type="host">amcglobal.sc.omtrdc.net</value>
</values>
</policy>
<policy id="frame-src">
<values>
<value id="amcdemdex" type="host">fast.amc.demdex.net</value>
</values>
</policy>
</policies>
</csp_whitelist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminNotificationToolbarSection">
<element name="notification" type="block" selector=".notifications-wrapper.admin__action-dropdown-wrap"/>
<element name="notificationCounter" type="block" selector=".notifications-action.admin__action-dropdown .notifications-counter"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminSystemNotificationToolbarBlockAclTest">
<annotations>
<features value="AdminNotification"/>
<stories value="Acl notification toolbar"/>
<title value="Admin system notification toolbar block acl test"/>
<description value="Admin should not see system notification toolbar block if acl not restricted"/>
<severity value="MAJOR"/>
<testCaseId value="MC-36011"/>
<group value="menu"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>

<actionGroup ref="AdminFillUserRoleRequiredDataActionGroup" stepKey="fillUserRoleRequiredData">
<argument name="User" value="adminRole"/>
<argument name="restrictedRole" value="Stores"/>
</actionGroup>
<actionGroup ref="AdminUserClickRoleResourceTabActionGroup" stepKey="goToRoleResourcesTab" />
<actionGroup ref="AdminAddRestrictedRoleActionGroup" stepKey="addRestrictedRoleStores">
<argument name="User" value="adminRole"/>
<argument name="restrictedRole" value="Products"/>
</actionGroup>
<actionGroup ref="AdminUserSaveRoleActionGroup" stepKey="saveUserRole" />

<actionGroup ref="AdminCreateUserActionGroup" stepKey="createAdminUser">
<argument name="role" value="adminRole"/>
<argument name="User" value="admin2"/>
</actionGroup>

<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsSaleRoleUser"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<!--Delete created data-->
<actionGroup ref="AdminUserOpenAdminRolesPageActionGroup" stepKey="navigateToUserRoleGrid"/>
<actionGroup ref="AdminDeleteRoleActionGroup" stepKey="deleteUserRole">
<argument name="role" value="adminRole"/>
</actionGroup>
<actionGroup ref="AdminOpenAdminUsersPageActionGroup" stepKey="goToAllUsersPage"/>
<actionGroup ref="AdminDeleteNewUserActionGroup" stepKey="deleteUser">
<argument name="userName" value="{{admin2.username}}"/>
</actionGroup>
</after>

<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser">
<argument name="username" value="{{admin2.username}}"/>
<argument name="password" value="{{admin2.password}}"/>
</actionGroup>

<waitForPageLoad stepKey="waitBeforePageLoad"/>
<dontSeeElement selector="{{AdminNotificationToolbarSection.notification}}" stepKey="doNotSeeNotificationBellIcon"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
template="Magento_AdminNotification::notification/window.phtml"/>
</referenceContainer>
<referenceContainer name="header">
<block class="Magento\AdminNotification\Block\ToolbarEntry" name="notification.messages" before="user" template="Magento_AdminNotification::toolbar_entry.phtml"/>
<block class="Magento\AdminNotification\Block\ToolbarEntry"
name="notification.messages"
before="user"
aclResource="Magento_AdminNotification::show_toolbar"
template="Magento_AdminNotification::toolbar_entry.phtml"/>
</referenceContainer>
</body>
</page>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;

/**
* Class AdvancedPricing
* Import advanced pricing class
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Expand All @@ -19,43 +19,27 @@
class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
{
const VALUE_ALL_GROUPS = 'ALL GROUPS';

const VALUE_ALL_WEBSITES = 'All Websites';

const COL_SKU = 'sku';

const COL_TIER_PRICE_WEBSITE = 'tier_price_website';

const COL_TIER_PRICE_CUSTOMER_GROUP = 'tier_price_customer_group';

const COL_TIER_PRICE_QTY = 'tier_price_qty';

const COL_TIER_PRICE = 'tier_price';

const COL_TIER_PRICE_PERCENTAGE_VALUE = 'percentage_value';

const COL_TIER_PRICE_TYPE = 'tier_price_value_type';

const TIER_PRICE_TYPE_FIXED = 'Fixed';

const TIER_PRICE_TYPE_PERCENT = 'Discount';

const TABLE_TIER_PRICE = 'catalog_product_entity_tier_price';

const DEFAULT_ALL_GROUPS_GROUPED_PRICE_VALUE = '0';

const ENTITY_TYPE_CODE = 'advanced_pricing';

const VALIDATOR_MAIN = 'validator';

const VALIDATOR_WEBSITE = 'validator_website';

/**
* @deprecated
* @see VALIDATOR_TIER_PRICE
*/
private const VALIDATOR_TEAR_PRICE = 'validator_tier_price';

private const VALIDATOR_TIER_PRICE = 'validator_tier_price';

/**
Expand Down Expand Up @@ -176,10 +160,8 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
* @param \Magento\ImportExport\Helper\Data $importExportData
* @param \Magento\ImportExport\Model\ResourceModel\Import\Data $importData
* @param \Magento\Eav\Model\Config $config
* @param \Magento\Framework\App\ResourceConnection $resource
* @param \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper
* @param \Magento\Framework\Stdlib\StringUtils $string
* @param ProcessingErrorAggregatorInterface $errorAggregator
* @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime
* @param \Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory
Expand All @@ -197,10 +179,8 @@ public function __construct(
\Magento\Framework\Json\Helper\Data $jsonHelper,
\Magento\ImportExport\Helper\Data $importExportData,
\Magento\ImportExport\Model\ResourceModel\Import\Data $importData,
\Magento\Eav\Model\Config $config,
\Magento\Framework\App\ResourceConnection $resource,
\Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper,
\Magento\Framework\Stdlib\StringUtils $string,
ProcessingErrorAggregatorInterface $errorAggregator,
\Magento\Framework\Stdlib\DateTime\DateTime $dateTime,
\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as RowValidatorInterface;
use Magento\CatalogImportExport\Model\Import\Product\StoreResolver;
use Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory as ResourceFactory;
use Magento\Eav\Model\Config;
use Magento\Eav\Model\Entity\Type;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\DB\Adapter\AdapterInterface;
Expand All @@ -26,7 +25,6 @@
use Magento\Framework\Json\Helper\Data;
use Magento\Framework\Stdlib\DateTime\DateTime;
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
use Magento\Framework\Stdlib\StringUtils;
use Magento\ImportExport\Model\Import;
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
use Magento\ImportExport\Model\ResourceModel\Helper;
Expand Down Expand Up @@ -99,11 +97,6 @@ class AdvancedPricingTest extends AbstractImportTestCase
*/
protected $dataSourceModel;

/**
* @var Config
*/
protected $eavConfig;

/**
* @var TimezoneInterface|MockObject
*/
Expand Down Expand Up @@ -139,11 +132,6 @@ class AdvancedPricingTest extends AbstractImportTestCase
*/
protected $advancedPricing;

/**
* @var StringUtils
*/
protected $stringObject;

/**
* @var ProcessingErrorAggregatorInterface
*/
Expand All @@ -165,10 +153,8 @@ protected function setUp(): void
);
$this->resource->method('getConnection')->willReturn($this->connection);
$this->dataSourceModel = $this->createMock(\Magento\ImportExport\Model\ResourceModel\Import\Data::class);
$this->eavConfig = $this->createMock(Config::class);
$entityType = $this->createMock(Type::class);
$entityType->method('getEntityTypeId')->willReturn('');
$this->eavConfig->method('getEntityType')->willReturn($entityType);
$this->resourceFactory = $this->getMockBuilder(
\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory::class
)
Expand All @@ -193,7 +179,6 @@ protected function setUp(): void
$this->tierPriceValidator = $this->createMock(
TierPrice::class
);
$this->stringObject = $this->createMock(StringUtils::class);
$this->errorAggregator = $this->getErrorAggregatorObject();
$this->dateTime = $this->getMockBuilder(DateTime::class)
->disableOriginalConstructor()
Expand Down Expand Up @@ -1070,10 +1055,8 @@ private function getAdvancedPricingMock($methods = [])
$this->jsonHelper,
$this->importExportData,
$this->dataSourceModel,
$this->eavConfig,
$this->resource,
$this->resourceHelper,
$this->stringObject,
$this->errorAggregator,
$this->dateTime,
$this->resourceFactory,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOpenConfigGeneralAnalyticsPageActionGroup">
<annotations>
<description>Open Config General Analytics Page.</description>
</annotations>

<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<waitForPageLoad stepKey="waitPageLoad"/>
</actionGroup>
</actionGroups>
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="AssertAdminAdvancedReportingPageUrlActionGroup">
<annotations>
<description>Assert admin advanced reporting page url.</description>
</annotations>

<switchToNextTab stepKey="switchToNewTab"/>
<waitForPageLoad stepKey="waitForAdvancedReportingPageLoad"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<amOnPage url="{{AdminDashboardPage.url}}" stepKey="amOnDashboardPage"/>
<waitForPageLoad stepKey="waitForDashboardPageLoad"/>
<click selector="{{AdminAdvancedReportingSection.goToAdvancedReporting}}" stepKey="clickGoToAdvancedReporting"/>
<switchToNextTab stepKey="switchToNewTab"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
<actionGroup ref="AssertAdminAdvancedReportingPageUrlActionGroup" stepKey="assertAdvancedReportingPageUrl"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
<argument name="menuUiId" value="{{AdminMenuReports.dataUiId}}"/>
<argument name="submenuUiId" value="{{AdminMenuReportsBusinessIntelligenceAdvancedReporting.dataUiId}}"/>
</actionGroup>
<switchToNextTab stepKey="switchToNewTab"/>
<waitForPageLoad stepKey="waitForAdvancedReportingPageLoad"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
<actionGroup ref="AssertAdminAdvancedReportingPageUrlActionGroup" stepKey="assertAdvancedReportingPageUrl"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
<testCaseId value="MAGETWO-63981"/>
<group value="analytics"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<actionGroup ref="AdminOpenConfigGeneralAnalyticsPageActionGroup" stepKey="amOnAdminConfig"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustryLabel}}" userInput="Industry" stepKey="seeAdvancedReportingIndustryLabel"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustry}}" userInput="--Please Select--" stepKey="selectAdvancedReportingIndustry"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
<testCaseId value="MAGETWO-66465"/>
<group value="analytics"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<actionGroup ref="AdminOpenConfigGeneralAnalyticsPageActionGroup" stepKey="amOnAdminConfig"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingServiceLabel}}" userInput="Advanced Reporting Service" stepKey="seeAdvancedReportingServiceLabelEnabled"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustryLabel}}" userInput="Industry" stepKey="seeAdvancedReportingIndustryLabel"/>
Expand Down
Loading

0 comments on commit 6f9a274

Please sign in to comment.