Skip to content

Commit 0081368

Browse files
merge magento/2.3-develop into magento-honey-badgers/MC-21811-Test
2 parents 73e3c9b + 496a855 commit 0081368

File tree

142 files changed

+5212
-643
lines changed

Some content is hidden

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

142 files changed

+5212
-643
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminSystemMessagesWarningActionGroup">
12+
<annotations>
13+
<description>Check warning system message exists.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="message" type="string"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{AdminSystemMessagesSection.systemMessagesDropdown}}" stepKey="waitMessagesDropdownAppears"/>
20+
<conditionalClick selector="{{AdminSystemMessagesSection.systemMessagesDropdown}}" dependentSelector="{{AdminSystemMessagesSection.messagesBlock}}" visible="false" stepKey="openMessagesBlockIfCollapsed"/>
21+
<see userInput="{{message}}" selector="{{AdminSystemMessagesSection.warning}}" stepKey="seeWarningMessage"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/AdminNotification/Test/Mftf/Section/AdminSystemMessagesSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@
1111
<section name="AdminSystemMessagesSection">
1212
<element name="systemMessagesDropdown" type="button" selector="#system_messages .message-system-action-dropdown"/>
1313
<element name="actionMessageLog" type="button" selector="//*[contains(@class, 'message-system-summary')]/a[contains(text(), '{{textMessage}}')]" parameterized="true"/>
14+
<element name="messagesBlock" type="block" selector="#system_messages div.message-system-collapsible"/>
15+
<element name="success" type="text" selector="#system_messages div.message-success"/>
16+
<element name="warning" type="text" selector="#system_messages div.message-warning"/>
17+
<element name="notice" type="text" selector="#system_messages div.message-notice"/>
1418
</section>
1519
</sections>

app/code/Magento/Backend/Block/Store/Switcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ public function getHintHtml()
592592
'What is this?'
593593
) . '"' . ' class="admin__field-tooltip-action action-help"><span>' . __(
594594
'What is this?'
595-
) . '</span></a></span>' . ' </div>';
595+
) . '</span></a>' . ' </div>';
596596
}
597597
return $html;
598598
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,13 @@
1414
<element name="error" type="text" selector="#messages div.message-error"/>
1515
<element name="notice" type="text" selector=".message.message-notice.notice"/>
1616
<element name="messageByType" type="text" selector="#messages div.message-{{messageType}}" parameterized="true" />
17+
<element name="warning" type="text" selector="#messages div.message-warning"/>
18+
<element name="accessDenied" type="text" selector=".access-denied-page"/>
19+
<!-- Deprecated elements, please do not use them. Use elements above-->
20+
<!-- Elements below are too common and catch non messages blocks. Ex: system messages blocks-->
21+
<element name="successMessage" type="text" selector=".message-success"/>
22+
<element name="errorMessage" type="text" selector=".message.message-error.error"/>
23+
<element name="warningMessage" type="text" selector=".message-warning"/>
24+
<element name="noticeMessage" type="text" selector=".message-notice"/>
1725
</section>
1826
</sections>

app/code/Magento/CardinalCommerce/etc/adminhtml/system.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,41 @@
1919
<label>Environment</label>
2020
<source_model>Magento\CardinalCommerce\Model\Adminhtml\Source\Environment</source_model>
2121
<config_path>three_d_secure/cardinal/environment</config_path>
22+
<depends>
23+
<field id="enabled_authorize">1</field>
24+
</depends>
2225
</field>
2326
<field id="org_unit_id" translate="label" type="obscure" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
2427
<label>Org Unit Id</label>
2528
<config_path>three_d_secure/cardinal/org_unit_id</config_path>
2629
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
30+
<depends>
31+
<field id="enabled_authorize">1</field>
32+
</depends>
2733
</field>
2834
<field id="api_key" translate="label" type="obscure" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
2935
<label>API Key</label>
3036
<config_path>three_d_secure/cardinal/api_key</config_path>
3137
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
38+
<depends>
39+
<field id="enabled_authorize">1</field>
40+
</depends>
3241
</field>
3342
<field id="api_identifier" translate="label" type="obscure" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0">
3443
<label>API Identifier</label>
3544
<config_path>three_d_secure/cardinal/api_identifier</config_path>
3645
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
46+
<depends>
47+
<field id="enabled_authorize">1</field>
48+
</depends>
3749
</field>
3850
<field id="debug" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="0">
3951
<label>Debug</label>
4052
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
4153
<config_path>three_d_secure/cardinal/debug</config_path>
54+
<depends>
55+
<field id="enabled_authorize">1</field>
56+
</depends>
4257
</field>
4358
</group>
4459
</group>

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

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
use Magento\Catalog\Api\Data\ProductCustomOptionValuesInterfaceFactory;
1212
use Magento\Catalog\Api\Data\ProductInterface;
1313
use Magento\Catalog\Model\Product;
14+
use Magento\Catalog\Model\Product\Option\Type\Date;
15+
use Magento\Catalog\Model\Product\Option\Type\DefaultType;
16+
use Magento\Catalog\Model\Product\Option\Type\File;
17+
use Magento\Catalog\Model\Product\Option\Type\Select;
18+
use Magento\Catalog\Model\Product\Option\Type\Text;
1419
use Magento\Catalog\Model\ResourceModel\Product\Option\Value\Collection;
1520
use Magento\Catalog\Pricing\Price\BasePrice;
1621
use Magento\Framework\EntityManager\MetadataPool;
@@ -98,6 +103,16 @@ class Option extends AbstractExtensibleModel implements ProductCustomOptionInter
98103
*/
99104
protected $validatorPool;
100105

106+
/**
107+
* @var string[]
108+
*/
109+
private $optionGroups;
110+
111+
/**
112+
* @var string[]
113+
*/
114+
private $optionTypesToGroups;
115+
101116
/**
102117
* @var MetadataPool
103118
*/
@@ -121,6 +136,8 @@ class Option extends AbstractExtensibleModel implements ProductCustomOptionInter
121136
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
122137
* @param array $data
123138
* @param ProductCustomOptionValuesInterfaceFactory|null $customOptionValuesFactory
139+
* @param array $optionGroups
140+
* @param array $optionTypesToGroups
124141
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
125142
*/
126143
public function __construct(
@@ -135,14 +152,34 @@ public function __construct(
135152
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
136153
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
137154
array $data = [],
138-
ProductCustomOptionValuesInterfaceFactory $customOptionValuesFactory = null
155+
ProductCustomOptionValuesInterfaceFactory $customOptionValuesFactory = null,
156+
array $optionGroups = [],
157+
array $optionTypesToGroups = []
139158
) {
140159
$this->productOptionValue = $productOptionValue;
141160
$this->optionTypeFactory = $optionFactory;
142-
$this->validatorPool = $validatorPool;
143161
$this->string = $string;
162+
$this->validatorPool = $validatorPool;
144163
$this->customOptionValuesFactory = $customOptionValuesFactory ?:
145164
\Magento\Framework\App\ObjectManager::getInstance()->get(ProductCustomOptionValuesInterfaceFactory::class);
165+
$this->optionGroups = $optionGroups ?: [
166+
self::OPTION_GROUP_DATE => Date::class,
167+
self::OPTION_GROUP_FILE => File::class,
168+
self::OPTION_GROUP_SELECT => Select::class,
169+
self::OPTION_GROUP_TEXT => Text::class,
170+
];
171+
$this->optionTypesToGroups = $optionTypesToGroups ?: [
172+
self::OPTION_TYPE_FIELD => self::OPTION_GROUP_TEXT,
173+
self::OPTION_TYPE_AREA => self::OPTION_GROUP_TEXT,
174+
self::OPTION_TYPE_FILE => self::OPTION_GROUP_FILE,
175+
self::OPTION_TYPE_DROP_DOWN => self::OPTION_GROUP_SELECT,
176+
self::OPTION_TYPE_RADIO => self::OPTION_GROUP_SELECT,
177+
self::OPTION_TYPE_CHECKBOX => self::OPTION_GROUP_SELECT,
178+
self::OPTION_TYPE_MULTIPLE => self::OPTION_GROUP_SELECT,
179+
self::OPTION_TYPE_DATE => self::OPTION_GROUP_DATE,
180+
self::OPTION_TYPE_DATE_TIME => self::OPTION_GROUP_DATE,
181+
self::OPTION_TYPE_TIME => self::OPTION_GROUP_DATE,
182+
];
146183

147184
parent::__construct(
148185
$context,
@@ -314,36 +351,22 @@ public function getGroupByType($type = null)
314351
if ($type === null) {
315352
$type = $this->getType();
316353
}
317-
$optionGroupsToTypes = [
318-
self::OPTION_TYPE_FIELD => self::OPTION_GROUP_TEXT,
319-
self::OPTION_TYPE_AREA => self::OPTION_GROUP_TEXT,
320-
self::OPTION_TYPE_FILE => self::OPTION_GROUP_FILE,
321-
self::OPTION_TYPE_DROP_DOWN => self::OPTION_GROUP_SELECT,
322-
self::OPTION_TYPE_RADIO => self::OPTION_GROUP_SELECT,
323-
self::OPTION_TYPE_CHECKBOX => self::OPTION_GROUP_SELECT,
324-
self::OPTION_TYPE_MULTIPLE => self::OPTION_GROUP_SELECT,
325-
self::OPTION_TYPE_DATE => self::OPTION_GROUP_DATE,
326-
self::OPTION_TYPE_DATE_TIME => self::OPTION_GROUP_DATE,
327-
self::OPTION_TYPE_TIME => self::OPTION_GROUP_DATE,
328-
];
329354

330-
return $optionGroupsToTypes[$type] ?? '';
355+
return $this->optionTypesToGroups[$type] ?? '';
331356
}
332357

333358
/**
334359
* Group model factory
335360
*
336361
* @param string $type Option type
337-
* @return \Magento\Catalog\Model\Product\Option\Type\DefaultType
362+
* @return DefaultType
338363
* @throws LocalizedException
339364
*/
340365
public function groupFactory($type)
341366
{
342367
$group = $this->getGroupByType($type);
343-
if (!empty($group)) {
344-
return $this->optionTypeFactory->create(
345-
'Magento\Catalog\Model\Product\Option\Type\\' . $this->string->upperCaseWords($group)
346-
);
368+
if (!empty($group) && isset($this->optionGroups[$group])) {
369+
return $this->optionTypeFactory->create($this->optionGroups[$group]);
347370
}
348371
throw new LocalizedException(__('The option type to get group instance is incorrect.'));
349372
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<selectOption selector="{{AdminCatalogProductWidgetSection.productAttributesToShow}}" parameterArray="['Name', 'Image', 'Price']" stepKey="selectAllProductAttributes"/>
1717
<selectOption selector="{{AdminCatalogProductWidgetSection.productButtonsToShow}}" parameterArray="['Add to Cart', 'Add to Compare', 'Add to Wishlist']" stepKey="selectAllProductButtons"/>
1818
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/>
19-
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForSuccessMessageAppears"/>
20-
<see selector="{{AdminMessagesSection.successMessage}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/>
19+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppears"/>
20+
<see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/>
2121
</actionGroup>
2222
</actionGroups>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<click selector="{{AdminUpdateAttributesSection.toggleDescription}}" stepKey="clickToChangeDescription"/>
2424
<fillField selector="{{AdminUpdateAttributesSection.description}}" userInput="{{product.description}}" stepKey="fillFieldDescription"/>
2525
<click selector="{{AdminUpdateAttributesSection.saveButton}}" stepKey="save"/>
26-
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitVisibleSuccessMessage"/>
27-
<see selector="{{AdminMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeSuccessMessage"/>
26+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitVisibleSuccessMessage"/>
27+
<see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue" stepKey="seeSuccessMessage"/>
2828
</actionGroup>
2929
</actionGroups>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
<description>Goes to the Storefront. Validates that the 2 provided Products appear in the correct order.</description>
1414
</annotations>
1515
<arguments>
16+
<argument name="page" defaultValue="{{StorefrontHomePage.url}}" type="string"/>
1617
<argument name="product_1"/>
1718
<argument name="product_2"/>
1819
</arguments>
1920

20-
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/>
21+
<amOnPage url="{{page}}" stepKey="goToHomePage"/>
2122
<waitForPageLoad stepKey="waitForPageLoad5"/>
2223
<grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByNumber('1')}}" userInput="alt" stepKey="grabFirstProductName1_1"/>
2324
<assertEquals expected="{{product_1.name}}" actual="($grabFirstProductName1_1)" message="notExpectedOrder" stepKey="compare1"/>

app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
<click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig" />
4646
<waitForPageLoad stepKey="waitSaveToApply"/>
4747
<!-- See if warning message displays -->
48-
<comment userInput="See if warning message displays" stepKey="checkWarningMessagePresence"/>
49-
<see selector="{{AdminMessagesSection.warningMessage}}" userInput="Please go to Cache Management and refresh cache types" stepKey="seeWarningMessage"/>
48+
<actionGroup ref="AdminSystemMessagesWarningActionGroup" stepKey="seeWarningMessage">
49+
<argument name="message" value="Please go to Cache Management and refresh cache types"/>
50+
</actionGroup>
5051
</test>
5152
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115

116116
<!-- "One or more indexers are invalid. Make sure your Magento cron job is running." global warning message appears -->
117117
<click selector="{{AdminSystemMessagesSection.systemMessagesDropdown}}" stepKey="openMessageSection"/>
118-
<see userInput="One or more indexers are invalid. Make sure your Magento cron job is running." selector="{{AdminMessagesSection.warningMessage}}" stepKey="seeWarningMessage"/>
118+
<see userInput="One or more indexers are invalid. Make sure your Magento cron job is running." selector="{{AdminSystemMessagesSection.warning}}" stepKey="seeWarningMessage"/>
119119

120120
<!-- Open categories K, L, M, N on Storefront in order to make sure that new assigments are not applied yet -->
121121
<!-- Category K contains only Products B & C -->

app/code/Magento/Catalog/etc/di.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,28 @@
411411
</argument>
412412
</arguments>
413413
</type>
414+
<type name="Magento\Catalog\Model\Product\Option">
415+
<arguments>
416+
<argument name="optionGroups" xsi:type="array">
417+
<item name="date" xsi:type="string">Magento\Catalog\Model\Product\Option\Type\Date</item>
418+
<item name="file" xsi:type="string">Magento\Catalog\Model\Product\Option\Type\File</item>
419+
<item name="select" xsi:type="string">Magento\Catalog\Model\Product\Option\Type\Select</item>
420+
<item name="text" xsi:type="string">Magento\Catalog\Model\Product\Option\Type\Text</item>
421+
</argument>
422+
<argument name="optionTypesToGroups" xsi:type="array">
423+
<item name="field" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_TEXT</item>
424+
<item name="area" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_TEXT</item>
425+
<item name="file" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_FILE</item>
426+
<item name="drop_down" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_SELECT</item>
427+
<item name="radio" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_SELECT</item>
428+
<item name="checkbox" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_SELECT</item>
429+
<item name="multiple" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_SELECT</item>
430+
<item name="date" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_DATE</item>
431+
<item name="date_time" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_DATE</item>
432+
<item name="time" xsi:type="const">Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_GROUP_DATE</item>
433+
</argument>
434+
</arguments>
435+
</type>
414436
<type name="Magento\Catalog\Model\Product\Option\Validator\Pool">
415437
<arguments>
416438
<argument name="validators" xsi:type="array">

app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/AdminExportActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<waitForPageLoad stepKey="waitForUserInput"/>
2727
<scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/>
2828
<click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/>
29-
<see selector="{{AdminMessagesSection.successMessage}}" userInput="Message is added to queue, wait to get your file soon" stepKey="seeSuccessMessage"/>
29+
<see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon" stepKey="seeSuccessMessage"/>
3030
</actionGroup>
3131

3232
<!-- Export products without filtering -->
@@ -41,7 +41,7 @@
4141
<wait stepKey="waitForScroll" time="5"/>
4242
<click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/>
4343
<wait stepKey="waitForClick" time="5"/>
44-
<see selector="{{AdminMessagesSection.successMessage}}" userInput="Message is added to queue, wait to get your file soon" stepKey="seeSuccessMessage"/>
44+
<see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon" stepKey="seeSuccessMessage"/>
4545
</actionGroup>
4646

4747
<!-- Download first file in the grid -->

0 commit comments

Comments
 (0)