Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit 4617e53

Browse files
committed
Merge remote-tracking branch 'origin/mtf-eol' into MC-4673
2 parents 5ab9d83 + c09e4af commit 4617e53

File tree

293 files changed

+6955
-875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+6955
-875
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535
- [ ] Pull request has a meaningful description of its purpose
3636
- [ ] All commits are accompanied by meaningful commit messages
3737
- [ ] All new or changed code is covered with unit/integration tests (if applicable)
38-
- [ ] All automated tests passed successfully (all builds on Travis CI are green)
38+
- [ ] All automated tests passed successfully (all builds are green)
File renamed without changes.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=2.3-develop)](https://travis-ci.org/magento/magento2)
21
[![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2)
32
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
43
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg)](https://crowdin.com/project/magento-2)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminPageIsNot404ActionGroup">
12+
<dontSee userInput="404 Error" selector="{{AdminHeaderSection.pageHeading}}" stepKey="dontSee404PageHeading"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertMessageInAdminPanelActionGroup">
12+
<arguments>
13+
<argument name="message" type="string" />
14+
<argument name="messageType" type="string" defaultValue="success" />
15+
</arguments>
16+
17+
<waitForElementVisible selector="{{AdminMessagesSection.messageByType(messageType)}}" stepKey="waitForMessageVisible" />
18+
<see userInput="{{message}}" selector="{{AdminMessagesSection.messageByType(messageType)}}" stepKey="verifyMessage" />
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertOrderGraphImageOnDashboardActionGroup">
12+
<click selector="{{AdminDashboardSection.ordersTab}}" stepKey="clickOrdersBtn"/>
13+
<seeElement selector="{{AdminDashboardSection.ordersChart}}" stepKey="seeGraphImage"/>
14+
</actionGroup>
15+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Page/AdminDashboardPage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="AdminDashboardPage" url="admin/dashboard/" area="admin" module="Magento_Backend">
1212
<section name="AdminMenuSection"/>
13+
<section name="AdminDashboardSection"/>
1314
</page>
1415
</pages>

app/code/Magento/Backend/Test/Mftf/Section/AdminDashboardSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminDashboardSection">
12+
<element name="ordersTab" type="button" selector="#diagram_tab_orders"/>
13+
<element name="ordersChart" type="button" selector="#diagram_tab_orders_content .dashboard-diagram-image img"/>
1214
<element name="dashboardDiagramContent" type="button" selector="#diagram_tab_content"/>
1315
<element name="dashboardDiagramOrderContentTab" type="block" selector="#diagram_tab_orders_content"/>
1416
<element name="dashboardDiagramAmounts" type="button" selector="#diagram_tab_amounts"/>

app/code/Magento/Backend/Test/Mftf/Section/AdminHeaderSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@
1111
<section name="AdminHeaderSection">
1212
<element name="pageTitle" type="text" selector=".page-header h1.page-title"/>
1313
<element name="adminUserAccountText" type="text" selector=".page-header .admin-user-account-text" />
14+
<!-- Legacy heading section. Mostly used for admin 404 and 403 pages -->
15+
<element name="pageHeading" type="text" selector=".page-content .page-heading"/>
1416
</section>
1517
</sections>

app/code/Magento/Backend/Test/Mftf/Section/AdminMessagesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<element name="nthSuccess" type="text" selector=".message.message-success.success:nth-of-type({{n}})>div" parameterized="true"/>
1414
<element name="error" type="text" selector="#messages div.message-error"/>
1515
<element name="notice" type="text" selector=".message.message-notice.notice"/>
16+
<element name="messageByType" type="text" selector="#messages div.message-{{messageType}}" parameterized="true" />
1617
</section>
1718
</sections>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminLoginAfterJSMinificationTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<title value="Admin panel should be accessible with JS minification enabled"/>
15+
<description value="Admin panel should be accessible with JS minification enabled"/>
16+
<testCaseId value="MC-14104" />
17+
<group value="backend"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
<before>
21+
<magentoCLI command="config:set {{MinifyJavaScriptFilesEnableConfigData.path}} {{MinifyJavaScriptFilesEnableConfigData.value}}" stepKey="enableJsMinification"/>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<magentoCLI command="config:set {{MinifyJavaScriptFilesDisableConfigData.path}} {{MinifyJavaScriptFilesDisableConfigData.value}}" stepKey="disableJsMinification"/>
26+
<actionGroup ref="logout" stepKey="logout"/>
27+
</after>
28+
29+
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="loggedInSuccessfully"/>
30+
<actionGroup ref="AssertAdminPageIsNot404ActionGroup" stepKey="dontSee404Page"/>
31+
</test>
32+
</tests>

app/code/Magento/Catalog/Block/Product/View.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ public function getAddToCartUrl($product, $additional = [])
169169
}
170170

171171
/**
172-
* Get JSON encoded configuration array which can be used for JS dynamic
173-
* price calculation depending on product options
172+
* Get JSON encoded configuration which can be used for JS dynamic price calculation depending on product options
174173
*
175174
* @return string
176175
*/
@@ -262,6 +261,7 @@ public function isStartCustomization()
262261

263262
/**
264263
* Get default qty - either as preconfigured, or as 1.
264+
*
265265
* Also restricts it by minimal qty.
266266
*
267267
* @param null|\Magento\Catalog\Model\Product $product
@@ -323,10 +323,7 @@ public function getQuantityValidators()
323323
public function getIdentities()
324324
{
325325
$identities = $this->getProduct()->getIdentities();
326-
$category = $this->_coreRegistry->registry('current_category');
327-
if ($category) {
328-
$identities[] = Category::CACHE_TAG . '_' . $category->getId();
329-
}
326+
330327
return $identities;
331328
}
332329

app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
use Magento\Catalog\Pricing\Price\CustomOptionPriceInterface;
1616

1717
/**
18-
* Product aoptions section abstract block.
18+
* Product options section abstract block.
1919
*
20+
* phpcs:disable Magento2.Classes.AbstractApi
2021
* @api
2122
* @since 100.0.2
2223
*/

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public function prepareProductAttributes(Product $product, array $productData, a
4646
}
4747

4848
/**
49+
* Reset "Use Config Settings" to false in product data.
50+
*
4951
* @param Product $product
5052
* @param string $attributeCode
5153
* @param array $productData
@@ -62,6 +64,8 @@ private function prepareConfigData(Product $product, string $attributeCode, arra
6264
}
6365

6466
/**
67+
* Prepare default attribute data for product.
68+
*
6569
* @param array $attributeList
6670
* @param string $attributeCode
6771
* @param array $productData
@@ -73,7 +77,7 @@ private function prepareDefaultData(array $attributeList, string $attributeCode,
7377
/** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */
7478
$attribute = $attributeList[$attributeCode];
7579
$attributeType = $attribute->getBackendType();
76-
// For non-numberic types set the attributeValue to 'false' to trigger their removal from the db
80+
// For non-numeric types set the attributeValue to 'false' to trigger their removal from the db
7781
if ($attributeType === 'varchar' || $attributeType === 'text' || $attributeType === 'datetime') {
7882
$attribute->setIsRequired(false);
7983
$productData[$attributeCode] = false;
@@ -86,6 +90,8 @@ private function prepareDefaultData(array $attributeList, string $attributeCode,
8690
}
8791

8892
/**
93+
* Check, whether attribute should not be updated.
94+
*
8995
* @param Product $product
9096
* @param array $useDefaults
9197
* @param string $attribute

app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77

88
namespace Magento\Catalog\Model\Product\Attribute\Backend\TierPrice;
99

10-
use Magento\Framework\EntityManager\Operation\ExtensionInterface;
1110
use Magento\Catalog\Api\Data\ProductInterface;
11+
use Magento\Framework\App\ObjectManager;
12+
use Magento\Framework\Locale\FormatInterface;
1213
use Magento\Store\Model\StoreManagerInterface;
1314
use Magento\Catalog\Api\ProductAttributeRepositoryInterface;
1415
use Magento\Customer\Api\GroupManagementInterface;
@@ -40,26 +41,34 @@ class UpdateHandler extends AbstractHandler
4041
*/
4142
private $tierPriceResource;
4243

44+
/**
45+
* @var FormatInterface
46+
*/
47+
private $localeFormat;
48+
4349
/**
4450
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
4551
* @param \Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository
4652
* @param \Magento\Customer\Api\GroupManagementInterface $groupManagement
4753
* @param \Magento\Framework\EntityManager\MetadataPool $metadataPool
4854
* @param \Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice $tierPriceResource
55+
* @param FormatInterface|null $localeFormat
4956
*/
5057
public function __construct(
5158
StoreManagerInterface $storeManager,
5259
ProductAttributeRepositoryInterface $attributeRepository,
5360
GroupManagementInterface $groupManagement,
5461
MetadataPool $metadataPool,
55-
Tierprice $tierPriceResource
62+
Tierprice $tierPriceResource,
63+
FormatInterface $localeFormat = null
5664
) {
5765
parent::__construct($groupManagement);
5866

5967
$this->storeManager = $storeManager;
6068
$this->attributeRepository = $attributeRepository;
6169
$this->metadataPoll = $metadataPool;
6270
$this->tierPriceResource = $tierPriceResource;
71+
$this->localeFormat = $localeFormat ?: ObjectManager::getInstance()->get(FormatInterface::class);
6372
}
6473

6574
/**
@@ -125,8 +134,9 @@ private function updateValues(array $valuesToUpdate, array $oldValues): bool
125134
{
126135
$isChanged = false;
127136
foreach ($valuesToUpdate as $key => $value) {
128-
if ((!empty($value['value']) && (float)$oldValues[$key]['price'] !== (float)$value['value'])
129-
|| $this->getPercentage($oldValues[$key]) !== $this->getPercentage($value)
137+
if ((!empty($value['value'])
138+
&& (float)$oldValues[$key]['price'] !== $this->localeFormat->getNumber($value['value'])
139+
) || $this->getPercentage($oldValues[$key]) !== $this->getPercentage($value)
130140
) {
131141
$price = new \Magento\Framework\DataObject(
132142
[

app/code/Magento/Catalog/Model/Product/Option/Type/Select.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
/**
1212
* Catalog product option select type
13+
*
14+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1315
*/
1416
class Select extends \Magento\Catalog\Model\Product\Option\Type\DefaultType
1517
{
@@ -30,23 +32,35 @@ class Select extends \Magento\Catalog\Model\Product\Option\Type\DefaultType
3032
*/
3133
protected $string;
3234

35+
/**
36+
* @var array
37+
*/
38+
private $singleSelectionTypes;
39+
3340
/**
3441
* @param \Magento\Checkout\Model\Session $checkoutSession
3542
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
3643
* @param \Magento\Framework\Stdlib\StringUtils $string
3744
* @param \Magento\Framework\Escaper $escaper
3845
* @param array $data
46+
* @param array $singleSelectionTypes
3947
*/
4048
public function __construct(
4149
\Magento\Checkout\Model\Session $checkoutSession,
4250
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
4351
\Magento\Framework\Stdlib\StringUtils $string,
4452
\Magento\Framework\Escaper $escaper,
45-
array $data = []
53+
array $data = [],
54+
array $singleSelectionTypes = []
4655
) {
4756
$this->string = $string;
4857
$this->_escaper = $escaper;
4958
parent::__construct($checkoutSession, $scopeConfig, $data);
59+
60+
$this->singleSelectionTypes = $singleSelectionTypes ?: [
61+
'drop_down' => \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN,
62+
'radio' => \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_RADIO,
63+
];
5064
}
5165

5266
/**
@@ -310,10 +324,6 @@ public function getOptionSku($optionValue, $skuDelimiter)
310324
*/
311325
protected function _isSingleSelection()
312326
{
313-
$single = [
314-
\Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN,
315-
\Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_RADIO,
316-
];
317-
return in_array($this->getOption()->getType(), $single);
327+
return in_array($this->getOption()->getType(), $this->singleSelectionTypes, true);
318328
}
319329
}

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Magento\Framework\DB\Select;
2020
use Magento\Framework\EntityManager\MetadataPool;
2121
use Magento\Framework\Indexer\DimensionFactory;
22-
use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;
2322
use Magento\Store\Model\Indexer\WebsiteDimensionProvider;
2423
use Magento\Store\Model\Store;
2524

@@ -808,7 +807,7 @@ public function load($printQuery = false, $logQuery = false)
808807
}
809808

810809
/**
811-
* Processs adding product website names to result collection
810+
* Process adding product website names to result collection
812811
*
813812
* @return $this
814813
*/

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductToCartActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<argument name="product" defaultValue="product"/>
1313
</arguments>
1414
<amOnPage url="{{StorefrontProductPage.url(product.custom_attributes[url_key])}}" stepKey="goToProductPage"/>
15+
<waitForPageLoad stepKey="waitForProductPage"/>
1516
<click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart"/>
1617
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/>
1718
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="CatalogInventoryOptionsShowOutOfStockEnable">
12+
<data key="path">cataloginventory/options/show_out_of_stock</data>
13+
<data key="label">Yes</data>
14+
<data key="value">1</data>
15+
</entity>
16+
<entity name="CatalogInventoryOptionsShowOutOfStockDisable">
17+
<!-- Magento default value -->
18+
<data key="path">cataloginventory/options/show_out_of_stock</data>
19+
<data key="label">No</data>
20+
<data key="value">0</data>
21+
</entity>
22+
<entity name="CatalogInventoryItemOptionsBackordersEnable">
23+
<data key="path">cataloginventory/item_options/backorders</data>
24+
<data key="label">Yes</data>
25+
<data key="value">1</data>
26+
</entity>
27+
<entity name="CatalogInventoryItemOptionsBackordersDisable">
28+
<!-- Magento default value -->
29+
<data key="path">cataloginventory/item_options/backorders</data>
30+
<data key="label">No</data>
31+
<data key="value">0</data>
32+
</entity>
33+
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,18 @@
153153
<data key="status">1</data>
154154
<data key="quantity">0</data>
155155
</entity>
156+
<entity name="SimpleProductInStockQuantityZero" type="product">
157+
<data key="sku" unique="suffix">testSku</data>
158+
<data key="type_id">simple</data>
159+
<data key="attribute_set_id">4</data>
160+
<data key="visibility">4</data>
161+
<data key="name" unique="suffix">SimpleProductInStockQuantityZero</data>
162+
<data key="price">123.00</data>
163+
<data key="urlKey" unique="suffix">SimpleProductInStockQuantityZero</data>
164+
<data key="status">1</data>
165+
<data key="quantity">0</data>
166+
<requiredEntity type="product_extension_attribute">EavStock0</requiredEntity>
167+
</entity>
156168
<!-- Simple Product Disabled -->
157169
<entity name="SimpleProductOffline" type="product2">
158170
<data key="sku" unique="suffix">testSku</data>

0 commit comments

Comments
 (0)