Skip to content

Commit b2fa5ca

Browse files
merge magento/2.3-develop into magento-honey-badgers/MC-17875
2 parents d0ff690 + 8cf8b1d commit b2fa5ca

File tree

123 files changed

+2985
-624
lines changed

Some content is hidden

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

123 files changed

+2985
-624
lines changed

app/code/Magento/Backend/Test/Mftf/ActionGroup/SetAdminAccountActionGroup.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="SetAdminAccountActionGroup">
1212
<arguments>
13-
<argument name="InterfaceLocaleByValue" type="string"/>
13+
<argument name="InterfaceLocaleByValue" defaultValue="en_US" type="string"/>
1414
</arguments>
1515
<!-- Navigate to admin System Account Page-->
1616
<amOnPage url="{{AdminSystemAccountPage.url}}" stepKey="openAdminSystemAccountPage" />
17-
<waitForPageLoad stepKey="loadAdminSystemAccountPage"/>
1817
<!-- Change Admin locale to Français (France) / French (France) -->
1918
<selectOption userInput="{{InterfaceLocaleByValue}}" selector="{{AdminSystemAccountSection.interfaceLocale}}" stepKey="setInterfaceLocate"/>
2019
<fillField selector="{{AdminSystemAccountSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
21-
<click selector="{{AdminCustomerMainActionsSection.saveButton}}" stepKey="clickSave"/>
22-
<waitForElement selector="{{AdminCustomerMessagesSection.successMessage}}" stepKey="waitSuccessMessage"/>
20+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
21+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessage"/>
22+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the account." stepKey="seeSuccessMessage"/>
2323
</actionGroup>
2424
</actionGroups>

app/code/Magento/Braintree/Model/LocaleResolver.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Magento\Framework\Locale\ResolverInterface;
99
use Magento\Braintree\Gateway\Config\PayPal\Config;
1010

11+
/**
12+
* Resolves locale for PayPal Express.
13+
*/
1114
class LocaleResolver implements ResolverInterface
1215
{
1316
/**
@@ -20,6 +23,17 @@ class LocaleResolver implements ResolverInterface
2023
*/
2124
private $config;
2225

26+
/**
27+
* Mapping Magento locales on PayPal locales.
28+
*
29+
* @var array
30+
*/
31+
private $localeMap = [
32+
'zh_Hans_CN' => 'zh_CN',
33+
'zh_Hant_HK' => 'zh_HK',
34+
'zh_Hant_TW' => 'zh_TW'
35+
];
36+
2337
/**
2438
* @param ResolverInterface $resolver
2539
* @param Config $config
@@ -66,10 +80,11 @@ public function setLocale($locale = null)
6680
* Gets store's locale or the `en_US` locale if store's locale does not supported by PayPal.
6781
*
6882
* @return string
83+
* @see https://braintree.github.io/braintree-web/current/PayPalCheckout.html#createPayment
6984
*/
7085
public function getLocale()
7186
{
72-
$locale = $this->resolver->getLocale();
87+
$locale = $this->localeMap[$this->resolver->getLocale()] ?? $this->resolver->getLocale();
7388
$allowedLocales = $this->config->getValue('supported_locales');
7489

7590
return strpos($allowedLocales, $locale) !== false ? $locale : 'en_US';

app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
10+
<!-- Skip by MQE-1576 -->
1111
<actionGroup name="ConfigureBraintree">
1212
<!-- GoTo ConfigureBraintree fields -->
1313
<click stepKey="clickOnSTORES" selector="{{AdminMenuSection.stores}}"/>
@@ -50,4 +50,4 @@
5050
<magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/>
5151
<magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/>
5252
</actionGroup>
53-
</actionGroups>
53+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
*/
77
-->
88

9-
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1110
<entity name="SampleBraintreeConfig" type="braintree_config_state">
1211
<requiredEntity type="title">SampleTitle</requiredEntity>
1312
<requiredEntity type="payment_action">SamplePaymentAction</requiredEntity>
@@ -54,13 +53,13 @@
5453
<data key="value">sandbox</data>
5554
</entity>
5655
<entity name="MerchantId" type="merchant_id">
57-
<data key="value">d4pdjhxgjfrsmzbf</data>
56+
<data key="value">MERCH_ID</data>
5857
</entity>
5958
<entity name="PublicKey" type="public_key">
60-
<data key="value">m7q4wmh43xrgyrst</data>
59+
<data key="value">PUBLIC_KEY</data>
6160
</entity>
6261
<entity name="PrivateKey" type="private_key">
63-
<data key="value">67de364080b1b4e2492d7a3de413a572</data>
62+
<data key="value">PRIVATE_KEY</data>
6463
</entity>
6564

6665
<!-- default configuration used to restore Magento config -->
@@ -138,14 +137,17 @@
138137
<data key="year">20</data>
139138
<data key="cvv">113</data>
140139
</entity>
140+
<entity name="StoredPaymentMethods">
141+
<data key="cardNumberEnding">5100</data>
142+
<data key="cardExpire">12/2020</data>
143+
</entity>
141144

142145
<entity name="BraintreeConfigurationData" type="data">
143146
<data key="title">Credit Card (Braintree)</data>
144-
<data key="merchantID">d4pdjhxgjfrsmzbf</data>
145-
<data key="publicKey">m7q4wmh43xrgyrst</data>
146-
<data key="privateKey">67de364080b1b4e2492d7a3de413a572</data>
147-
<data key="merchantAccountID">Magneto</data>
147+
<data key="merchantID">MERCH_ID</data>
148+
<data key="publicKey">PUBLIC_KEY</data>
149+
<data key="privateKey">PRIVATE_KEY</data>
150+
<data key="merchantAccountID">MERCH_ACCOUNT_ID</data>
148151
<data key="titleForPayPalThroughBraintree">PayPal (Braintree)</data>
149152
</entity>
150-
151153
</entities>

app/code/Magento/Braintree/Test/Mftf/Test/BraintreeCreditCardOnCheckoutTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MAGETWO-93767"/>
1919
<group value="braintree"/>
20+
<skip>
21+
<issueId value="MQE-1576"/>
22+
</skip>
2023
</annotations>
2124

2225
<before>

app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-93677"/>
1919
<group value="braintree"/>
20+
<skip>
21+
<issueId value="MQE-1576"/>
22+
</skip>
2023
</annotations>
2124

2225

app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-94472"/>
1919
<group value="braintree"/>
20+
<skip>
21+
<issueId value="MQE-1576"/>
22+
</skip>
2023
</annotations>
2124

2225
<before>

app/code/Magento/Braintree/Test/Unit/Model/LocaleResolverTest.php

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,35 @@ public function testSetLocale()
9898
/**
9999
* Test getLocale method
100100
*
101-
* @return void
101+
* @param string $locale
102+
* @param string $expectedLocale
103+
* @dataProvider getLocaleDataProvider
102104
*/
103-
public function testGetLocale()
105+
public function testGetLocale(string $locale, string $expectedLocale)
104106
{
105-
$locale = 'en_TEST';
106-
$allowedLocales = 'en_US,en_GB,en_AU,da_DK,fr_FR,fr_CA,de_DE,zh_HK,it_IT,nl_NL';
107-
$this->resolverMock->expects($this->once())->method('getLocale')->willReturn($locale);
108-
$this->configMock->expects($this->once())->method('getValue')->with('supported_locales')
107+
$allowedLocales = 'en_US,en_GB,en_AU,da_DK,fr_FR,fr_CA,de_DE,zh_HK,it_IT,zh_CN,zh_TW,nl_NL';
108+
$this->resolverMock->method('getLocale')
109+
->willReturn($locale);
110+
$this->configMock->method('getValue')
111+
->with('supported_locales')
109112
->willReturn($allowedLocales);
110-
111-
$expected = 'en_US';
112113
$actual = $this->localeResolver->getLocale();
113-
self::assertEquals($expected, $actual);
114+
115+
self::assertEquals($expectedLocale, $actual);
116+
}
117+
118+
/**
119+
* @return array
120+
*/
121+
public function getLocaleDataProvider(): array
122+
{
123+
return [
124+
['locale' => 'zh_Hans_CN', 'expectedLocale' => 'zh_CN'],
125+
['locale' => 'zh_Hant_HK', 'expectedLocale' => 'zh_HK'],
126+
['locale' => 'zh_Hant_TW', 'expectedLocale' => 'zh_TW'],
127+
['locale' => 'fr_FR', 'expectedLocale' => 'fr_FR'],
128+
['locale' => 'unknown', 'expectedLocale' => 'en_US'],
129+
];
114130
}
115131

116132
/**

app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<!--Category Selection-->
9393
<element name="categoryByName" type="multiselect" selector="//div[@data-index='category_ids']//span[contains(text(), '{{category}}')]" parameterized="true"/>
9494
<element name="searchForCategory" type="input" selector="div.action-menu._active > div.admin__action-multiselect-search-wrap input" timeout="30"/>
95-
<element name="selectCategory" type="multiselect" selector="//div[@class='action-menu _active']//label[@class='admin__action-multiselect-label']"/>
95+
<element name="selectCategory" type="multiselect" selector="//div[@class='action-menu _active']//label[@class='admin__action-multiselect-label']" timeout="30"/>
9696
<element name="categoriesLabel" type="text" selector="//div[@class='action-menu _active']//button[@data-action='close-advanced-select']"/>
9797
<element name="userDefinedQuantity" type="checkbox" selector="[name='bundle_options[bundle_options][{{option}}][bundle_selections][{{product}}][selection_can_change_qty]'][type='checkbox']" parameterized="true"/>
9898
</section>

app/code/Magento/Bundle/view/adminhtml/templates/sales/order/view/items/renderer.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
</td>
155155
<td class="col-discont">
156156
<?php if ($block->canShowPriceInfo($_item)) : ?>
157-
<?= $block->escapeHtml($block->displayPriceAttribute('discount_amount')) ?>
157+
<?= /* @noEscape */ $block->displayPriceAttribute('discount_amount') ?>
158158
<?php else : ?>
159159
&nbsp;
160160
<?php endif; ?>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Catalog\Model\Category;
9+
10+
use Magento\Catalog\Api\CategoryRepositoryInterface;
11+
use Magento\Catalog\Model\Category;
12+
use Magento\Store\Api\GroupRepositoryInterface;
13+
14+
/**
15+
* Fetcher for associated with store group categories.
16+
*/
17+
class StoreCategories
18+
{
19+
/**
20+
* @var CategoryRepositoryInterface
21+
*/
22+
private $categoryRepository;
23+
24+
/**
25+
* @var GroupRepositoryInterface
26+
*/
27+
private $groupRepository;
28+
29+
/**
30+
* @param CategoryRepositoryInterface $categoryRepository
31+
* @param GroupRepositoryInterface $groupRepository
32+
*/
33+
public function __construct(
34+
CategoryRepositoryInterface $categoryRepository,
35+
GroupRepositoryInterface $groupRepository
36+
) {
37+
$this->categoryRepository = $categoryRepository;
38+
$this->groupRepository = $groupRepository;
39+
}
40+
41+
/**
42+
* Get all category ids for store.
43+
*
44+
* @param int|null $storeGroupId
45+
* @return int[]
46+
* @throws \Magento\Framework\Exception\NoSuchEntityException
47+
*/
48+
public function getCategoryIds(?int $storeGroupId = null): array
49+
{
50+
$rootCategoryId = $storeGroupId
51+
? $this->groupRepository->get($storeGroupId)->getRootCategoryId()
52+
: Category::TREE_ROOT_ID;
53+
/** @var Category $rootCategory */
54+
$rootCategory = $this->categoryRepository->get($rootCategoryId);
55+
$categoriesIds = array_map(
56+
function ($value) {
57+
return (int) $value;
58+
},
59+
(array) $rootCategory->getAllChildren(true)
60+
);
61+
62+
return $categoriesIds;
63+
}
64+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminChangeProductSEOSettingsActionGroup">
12+
<arguments>
13+
<argument name="productName" defaultValue="_defaultProduct.name"/>
14+
</arguments>
15+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickSearchEngineOptimizationTab"/>
16+
<waitForPageLoad stepKey="waitForTabOpen"/>
17+
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{productName}}" stepKey="setUrlKeyInput"/>
18+
<fillField selector="{{AdminProductSEOSection.metaTitleInput}}" userInput="{{productName}}" stepKey="setMetaTitleInput"/>
19+
<fillField selector="{{AdminProductSEOSection.metaKeywordsInput}}" userInput="{{productName}}" stepKey="setMetaKeywordsInput"/>
20+
<fillField selector="{{AdminProductSEOSection.metaDescriptionInput}}" userInput="{{productName}}" stepKey="setMetaDescriptionInput"/>
21+
</actionGroup>
22+
</actionGroups>

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@
275275
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
276276
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
277277
<waitForPageLoad stepKey="waitForPageToLoad"/>
278-
<checkOption selector="{{AdminProductModalSlideGridSection.productRowCheckboxBySku(sku)}}" stepKey="selectProduct"/>
278+
<click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/>
279279
<click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/>
280+
<waitForElementNotVisible selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="waitForElementNotVisible"/>
280281
</actionGroup>
281282

282283
<!--Click AddCrossSellProducts and adds product by SKU-->
@@ -495,6 +496,19 @@
495496
<click selector="{{AdminAddUpSellProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/>
496497
<waitForPageLoad stepKey="waitForPageToLoad1"/>
497498
</actionGroup>
499+
<actionGroup name="adminProductAdvancedPricingNewCustomerGroupPrice">
500+
<arguments>
501+
<argument name="qty" type="string" defaultValue="2"/>
502+
<argument name="priceType" type="string" defaultValue="Discount"/>
503+
<argument name="discount" type="string" defaultValue="75"/>
504+
<argument name="customerGroup" type="string" defaultValue="0"/>
505+
</arguments>
506+
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroup"/>
507+
<fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput(customerGroup)}}" userInput="{{qty}}" stepKey="fillProductTierPriceQtyInput1"/>
508+
<selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect(customerGroup)}}" userInput="{{priceType}}" stepKey="selectProductTierPriceValueType1"/>
509+
<fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput(customerGroup)}}" userInput="{{discount}}" stepKey="selectProductTierPricePriceInput"/>
510+
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton1"/>
511+
</actionGroup>
498512
<actionGroup name="AdminSetProductDisabled">
499513
<conditionalClick selector="{{AdminProductFormSection.enableProductLabel}}" dependentSelector="{{AdminProductFormSection.productStatusValue('1')}}" visible="true" stepKey="disableProduct"/>
500514
<seeElement selector="{{AdminProductFormSection.productStatusValue('2')}}" stepKey="assertThatProductSetToDisabled"/>
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="AdminSetProductDesignSettingsActionGroup">
12+
<arguments>
13+
<argument name="designSettings" defaultValue="simpleBlankDesign"/>
14+
</arguments>
15+
<click selector="{{ProductDesignSection.DesignTab}}" stepKey="clickDesignTab"/>
16+
<waitForPageLoad stepKey="waitForTabOpen"/>
17+
<selectOption selector="{{ProductDesignSection.LayoutDropdown}}" userInput="{{designSettings.page_layout}}" stepKey="setLayout"/>
18+
<selectOption selector="{{ProductDesignSection.productOptionsContainer}}" userInput="{{designSettings.options_container}}" stepKey="setDisplayProductOptions"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AdminSwitchProductGiftMessageStatusActionGroup">
12+
<arguments>
13+
<argument name="status" defaultValue="0"/>
14+
</arguments>
15+
<click selector="{{AdminProductGiftOptionsSection.giftOptions}}" stepKey="clickToExpandGiftOptionsTab"/>
16+
<waitForPageLoad stepKey="waitForGiftOptionsOpen"/>
17+
<uncheckOption selector="{{AdminProductGiftOptionsSection.useConfigSettingsMessage}}" stepKey="uncheckConfigSettingsMessage"/>
18+
<click selector="{{AdminProductGiftOptionsSection.toggleProductGiftMessage}}" stepKey="clickToGiftMessageSwitcher"/>
19+
<seeElement selector="{{AdminProductGiftOptionsSection.giftMessageStatus('status')}}" stepKey="assertGiftMessageStatus"/>
20+
</actionGroup>
21+
</actionGroups>

0 commit comments

Comments
 (0)