Skip to content

Commit 11bd9ba

Browse files
committed
Merge remote-tracking branch 'upstream/2.4-develop' into no-author/paypal
2 parents 0375e5d + 867d074 commit 11bd9ba

File tree

2,426 files changed

+46712
-8308
lines changed

Some content is hidden

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

2,426 files changed

+46712
-8308
lines changed

app/code/Magento/AdminNotification/Test/Mftf/Test/AdminSystemNotificationNavigateMenuTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<group value="menu"/>
2020
<group value="mtf_migrated"/>
2121
<group value="pr_exclude"/>
22+
<group value="cloud"/>
2223
</annotations>
2324
<before>
2425
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>

app/code/Magento/AdminNotification/Test/Mftf/Test/AdminSystemNotificationToolbarBlockAclTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-36011"/>
1919
<group value="menu"/>
20+
<group value="cloud"/>
2021
</annotations>
2122
<before>
2223
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>

app/code/Magento/AdvancedSearch/Test/Mftf/Test/AdminAddSearchTermTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<severity value="CRITICAL"/>
1818
<group value="AdvancedSearch"/>
1919
<group value="pr_exclude"/>
20+
<group value="cloud"/>
2021
</annotations>
2122
<before>
2223
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingButtonTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<group value="analytics"/>
1919
<group value="mtf_migrated"/>
2020
<group value="pr_exclude"/>
21+
<group value="cloud"/>
2122
</annotations>
2223

2324
<before>

app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingNavigateMenuTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<group value="menu"/>
2020
<group value="mtf_migrated"/>
2121
<group value="pr_exclude"/>
22+
<group value="cloud"/>
2223
</annotations>
2324
<before>
2425
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>

app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationBlankIndustryTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<testCaseId value="MAGETWO-63981"/>
1818
<group value="analytics"/>
1919
<group value="pr_exclude"/>
20+
<group value="cloud"/>
2021
</annotations>
2122
<before>
2223
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationIndustryTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<testCaseId value="MAGETWO-63898"/>
1919
<group value="analytics"/>
2020
<group value="pr_exclude"/>
21+
<group value="cloud"/>
2122
</annotations>
2223
<before>
2324
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationTimeToSendDataTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<testCaseId value="MAGETWO-66464"/>
1919
<group value="analytics"/>
2020
<group value="pr_exclude"/>
21+
<group value="cloud"/>
2122
</annotations>
2223
<before>
2324
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/AsyncConfig/Test/Mftf/Test/AsyncConfigurationTest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@
2121
<before>
2222
<!--Enable Async Configuration-->
2323
<magentoCLI stepKey="EnableAsyncConfig" command="setup:config:set --no-interaction --config-async 1"/>
24-
<magentoCLI stepKey="ClearConfigCache" command="cache:flush"/>
24+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="ClearConfigCache">
25+
<argument name="tags" value=""/>
26+
</actionGroup>
2527
<!--Login to Admin-->
2628
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
2729
</before>
2830
<after>
2931
<magentoCLI stepKey="DisableAsyncConfig" command="setup:config:set --no-interaction --config-async 0"/>
3032
<magentoCLI stepKey="setBackDefaultConfigValue" command="config:set catalog/frontend/grid_per_page 12" />
31-
<magentoCLI stepKey="ClearConfigCache" command="cache:clean"/>
33+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="ClearConfigCache">
34+
<argument name="tags" value="config"/>
35+
</actionGroup>
3236
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
3337
</after>
3438

app/code/Magento/AsynchronousOperations/Model/ResourceModel/System/Message/Collection/Synchronized/Plugin.php

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111
class Plugin
1212
{
13+
private const MESSAGES_LIMIT = 5;
1314
/**
1415
* @var \Magento\AdminNotification\Model\System\MessageFactory
1516
*/
@@ -95,27 +96,32 @@ public function afterToArray(
9596
$this->bulkNotificationManagement->getAcknowledgedBulksByUser($userId)
9697
);
9798
$bulkMessages = [];
99+
$messagesCount = 0;
100+
$data = [];
98101
foreach ($userBulks as $bulk) {
99102
$bulkUuid = $bulk->getBulkId();
100103
if (!in_array($bulkUuid, $acknowledgedBulks)) {
101-
$details = $this->operationDetails->getDetails($bulkUuid);
102-
$text = $this->getText($details);
103-
$bulkStatus = $this->statusMapper->operationStatusToBulkSummaryStatus($bulk->getStatus());
104-
if ($bulkStatus === \Magento\Framework\Bulk\BulkSummaryInterface::IN_PROGRESS) {
105-
$text = __('%1 item(s) are currently being updated.', $details['operations_total']) . $text;
104+
if ($messagesCount < self::MESSAGES_LIMIT) {
105+
$details = $this->operationDetails->getDetails($bulkUuid);
106+
$text = $this->getText($details);
107+
$bulkStatus = $this->statusMapper->operationStatusToBulkSummaryStatus($bulk->getStatus());
108+
if ($bulkStatus === \Magento\Framework\Bulk\BulkSummaryInterface::IN_PROGRESS) {
109+
$text = __('%1 item(s) are currently being updated.', $details['operations_total']) . $text;
110+
}
111+
$data = [
112+
'data' => [
113+
'text' => __('Task "%1": ', $bulk->getDescription()) . $text,
114+
'severity' => \Magento\Framework\Notification\MessageInterface::SEVERITY_MAJOR,
115+
// md5() here is not for cryptographic use.
116+
// phpcs:ignore Magento2.Security.InsecureFunction
117+
'identity' => md5('bulk' . $bulkUuid),
118+
'uuid' => $bulkUuid,
119+
'status' => $bulkStatus,
120+
'created_at' => $bulk->getStartTime()
121+
]
122+
];
123+
$messagesCount++;
106124
}
107-
$data = [
108-
'data' => [
109-
'text' => __('Task "%1": ', $bulk->getDescription()) . $text,
110-
'severity' => \Magento\Framework\Notification\MessageInterface::SEVERITY_MAJOR,
111-
// md5() here is not for cryptographic use.
112-
// phpcs:ignore Magento2.Security.InsecureFunction
113-
'identity' => md5('bulk' . $bulkUuid),
114-
'uuid' => $bulkUuid,
115-
'status' => $bulkStatus,
116-
'created_at' => $bulk->getStartTime()
117-
]
118-
];
119125
$bulkMessages[] = $this->messageFactory->create($data)->toArray();
120126
}
121127
}

app/code/Magento/AsynchronousOperations/Test/Unit/Model/ResourceModel/System/Message/Collection/Synchronized/PluginTest.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
*/
2828
class PluginTest extends TestCase
2929
{
30+
private const MESSAGES_LIMIT = 5;
3031
/**
3132
* @var Plugin
3233
*/
@@ -163,6 +164,60 @@ public function testAfterTo($operationDetails)
163164
$this->assertEquals(2, $result2['totalRecords']);
164165
}
165166

167+
/**
168+
* Tests that message building operations don't get called more than Plugin::MESSAGES_LIMIT times
169+
*
170+
* @return void
171+
*/
172+
public function testAfterToWithMessageLimit()
173+
{
174+
$result = ['items' =>[], 'totalRecords' => 1];
175+
$messagesCount = self::MESSAGES_LIMIT + 1;
176+
$userId = 1;
177+
$bulkUuid = 2;
178+
$bulkArray = [
179+
'status' => BulkSummaryInterface::NOT_STARTED
180+
];
181+
182+
$bulkMock = $this->getMockBuilder(BulkSummary::class)
183+
->addMethods(['getStatus'])
184+
->onlyMethods(['getBulkId', 'getDescription', 'getStartTime'])
185+
->disableOriginalConstructor()
186+
->getMock();
187+
$userBulks = array_fill(0, $messagesCount, $bulkMock);
188+
$bulkMock->expects($this->exactly($messagesCount))
189+
->method('getBulkId')->willReturn($bulkUuid);
190+
$this->operationsDetailsMock
191+
->expects($this->exactly(self::MESSAGES_LIMIT))
192+
->method('getDetails')
193+
->with($bulkUuid)
194+
->willReturn([
195+
'operations_successful' => 1,
196+
'operations_failed' => 0
197+
]);
198+
$bulkMock->expects($this->exactly(self::MESSAGES_LIMIT))
199+
->method('getDescription')->willReturn('Bulk Description');
200+
$this->messagefactoryMock->expects($this->exactly($messagesCount))
201+
->method('create')->willReturn($this->messageMock);
202+
$this->messageMock->expects($this->exactly($messagesCount))->method('toArray')->willReturn($bulkArray);
203+
$this->authorizationMock
204+
->expects($this->once())
205+
->method('isAllowed')
206+
->with($this->resourceName)
207+
->willReturn(true);
208+
$this->userContextMock->expects($this->once())->method('getUserId')->willReturn($userId);
209+
$this->bulkNotificationMock
210+
->expects($this->once())
211+
->method('getAcknowledgedBulksByUser')
212+
->with($userId)
213+
->willReturn([]);
214+
$this->statusMapper->expects($this->exactly(self::MESSAGES_LIMIT))
215+
->method('operationStatusToBulkSummaryStatus');
216+
$this->bulkStatusMock->expects($this->once())->method('getBulksByUser')->willReturn($userBulks);
217+
$result2 = $this->plugin->afterToArray($this->collectionMock, $result);
218+
$this->assertEquals($result['totalRecords'] + $messagesCount, $result2['totalRecords']);
219+
}
220+
166221
/**
167222
* @return array
168223
*/

app/code/Magento/Authorization/Model/CompositeUserContext.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Authorization\Model;
88

99
use Magento\Framework\ObjectManager\Helper\Composite as CompositeHelper;
10+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1011

1112
/**
1213
* User context.
@@ -17,7 +18,7 @@
1718
* @api
1819
* @since 100.0.2
1920
*/
20-
class CompositeUserContext implements \Magento\Authorization\Model\UserContextInterface
21+
class CompositeUserContext implements \Magento\Authorization\Model\UserContextInterface, ResetAfterRequestInterface
2122
{
2223
/**
2324
* @var UserContextInterface[]
@@ -92,4 +93,12 @@ protected function getUserContext()
9293
}
9394
return $this->chosenUserContext;
9495
}
96+
97+
/**
98+
* @inheritDoc
99+
*/
100+
public function _resetState(): void
101+
{
102+
$this->chosenUserContext = null;
103+
}
95104
}

app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminCreateDownloadableProductWithLinkTest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<comment userInput="BIC workaround" stepKey="disableRemoteStorage"/>
3636
<magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/>
3737
<!-- Delete customer -->
38+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" />
3839
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
3940

4041
<!-- Delete category -->
@@ -81,7 +82,9 @@
8182

8283
<!-- Save product -->
8384
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
84-
<magentoCron stepKey="runIndexCronJobs" groups="index"/>
85+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runIndexCronJobs">
86+
<argument name="indices" value=""/>
87+
</actionGroup>
8588

8689
<!-- Login to frontend -->
8790
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signIn">

app/code/Magento/Backend/Model/Auth/Session.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ public function __construct(
114114
);
115115
}
116116

117+
/**
118+
* @inheritDoc
119+
*/
120+
public function _resetState(): void
121+
{
122+
parent::_resetState();
123+
$this->_isFirstAfterLogin = null;
124+
$this->acl = null;
125+
}
126+
117127
/**
118128
* Refresh ACL resources stored in session
119129
*

app/code/Magento/Backend/Model/Session/Quote.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ public function __construct(
139139
}
140140
}
141141

142+
/**
143+
* @inheritDoc
144+
*/
145+
public function _resetState(): void
146+
{
147+
parent::_resetState();
148+
$this->_quote = null;
149+
$this->_store = null;
150+
$this->_order = null;
151+
}
152+
142153
/**
143154
* Retrieve quote model object
144155
*
@@ -154,7 +165,7 @@ public function getQuote()
154165
$this->_quote->setCustomerGroupId($customerGroupId);
155166
$this->_quote->setIsActive(false);
156167
$this->_quote->setStoreId($this->getStoreId());
157-
168+
158169
$this->quoteRepository->save($this->_quote);
159170
$this->setQuoteId($this->_quote->getId());
160171
$this->_quote = $this->quoteRepository->get($this->getQuoteId(), [$this->getStoreId()]);

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323
<click stepKey="resetFilters" selector="{{AdminSecondaryGridSection.resetFilters}}"/>
2424
<fillField stepKey="fillIdentifier" selector="{{searchInput}}" userInput="{{name}}"/>
2525
<click stepKey="searchForName" selector="{{AdminSecondaryGridSection.searchButton}}"/>
26+
<waitForPageLoad stepKey="waitForPageLoad" />
27+
<waitForElementClickable selector="{{AdminSecondaryGridSection.firstRow}}" stepKey="waitForResult"/>
2628
<click stepKey="clickResult" selector="{{AdminSecondaryGridSection.firstRow}}"/>
2729
<waitForPageLoad stepKey="waitForTaxRateLoad"/>
2830

2931
<!-- delete the rule -->
30-
<waitForElementVisible selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="waitForDelete"/>
32+
<waitForElementClickable selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="waitForDelete"/>
3133
<click stepKey="clickDelete" selector="{{AdminStoresMainActionsSection.deleteButton}}"/>
3234
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmationModal"/>
3335
<click stepKey="clickOk" selector="{{AdminConfirmationModalSection.ok}}"/>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
<element name="defaultLocale" type="checkbox" selector="#general_locale_code_inherit"/>
1919
<element name="checkIfTabExpand" type="button" selector="#general_locale-head:not(.open)"/>
2020
<element name="timeZoneDropdown" type="select" selector="//select[@id='general_locale_timezone']"/>
21+
<element name="changeStoreConfigButton" type="button" selector="//button[@id='store-change-button']"/>
22+
<element name="changeStoreConfigToSpecificWebsite" type="select" selector="//a[contains(text(),'{{var}}')]" parameterized="true"/>
23+
<element name="changeWebsiteConfirmButton" type="button" selector="//button[@class='action-primary action-accept']/span"/>
2124
</section>
2225
</sections>

app/code/Magento/Backend/Test/Mftf/Test/AdminAttributeTextSwatchesCanBeFiledTest.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<useCaseId value="MAGETWO-96409"/>
2020
<group value="backend"/>
2121
<group value="ui"/>
22+
<group value="cloud"/>
2223
</annotations>
2324
<before>
2425

@@ -57,7 +58,9 @@
5758
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView10">
5859
<argument name="customStore" value="storeViewData7"/>
5960
</actionGroup>
60-
<magentoCron groups="index" stepKey="reindex"/>
61+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
62+
<argument name="indices" value=""/>
63+
</actionGroup>
6164

6265
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
6366
</after>
@@ -93,7 +96,9 @@
9396
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView10">
9497
<argument name="customStore" value="storeViewData7"/>
9598
</actionGroup>
96-
<magentoCron groups="index" stepKey="reindex"/>
99+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
100+
<argument name="indices" value=""/>
101+
</actionGroup>
97102

98103
<!--Navigate to Product attribute page-->
99104
<actionGroup ref="AdminNavigateToNewProductAttributePageActionGroup" stepKey="navigateToNewProductAttributePage"/>

app/code/Magento/Backend/Test/Mftf/Test/AdminCatalogEmailToFriendSettingsTest.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,23 @@
1515
<title value="Admin should be able to manage settings of Email To A Friend Functionality"/>
1616
<description value="Admin should be able to enable Email To A Friend functionality in Magento Admin backend and see additional options"/>
1717
<group value="backend"/>
18-
<severity value="MINOR"></severity>
18+
<severity value="MINOR"/>
1919
<testCaseId value="MC-35895"/>
2020
<group value="pr_exclude"/>
2121
</annotations>
2222

2323
<before>
2424
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2525
<magentoCLI stepKey="enableSendFriend" command="config:set sendfriend/email/enabled 1"/>
26-
<magentoCLI stepKey="cacheClean" command="cache:clean config"/>
26+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cacheClean">
27+
<argument name="tags" value="config"/>
28+
</actionGroup>
2729
</before>
2830
<after>
2931
<magentoCLI stepKey="disableSendFriend" command="config:set sendfriend/email/enabled 0"/>
30-
<magentoCLI stepKey="cacheClean" command="cache:clean config"/>
32+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cacheClean">
33+
<argument name="tags" value="config"/>
34+
</actionGroup>
3135
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3236
</after>
3337

app/code/Magento/Backend/Test/Mftf/Test/AdminCheckDashboardWithChartsTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
<argument name="tags" value="config full_page"/>
5252
</actionGroup>
5353
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
54+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" />
5455
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
5556
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
5657
</after>

0 commit comments

Comments
 (0)