Skip to content

Commit f2f7072

Browse files
committed
Merge remote-tracking branch 'performance/CABPI-410-combined' into 2.4.5-develop
2 parents 4d935b0 + c813a54 commit f2f7072

File tree

10 files changed

+73
-46
lines changed

10 files changed

+73
-46
lines changed

app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminAdobeImsSignInActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<click selector="{{AdminAdobeImsSignInSection.AdobeImsUsernameContinueButton}}" stepKey="clickUsernameContinue"/>
2525

2626
<click selector="{{AdminAdobeImsSignInSection.AdobeImsProfileSelect}}" stepKey="clickProfile"/>
27-
27+
<wait time="10" stepKey="waitTenSeconds"/>
2828
<fillField selector="{{AdminAdobeImsSignInSection.password}}" userInput="{{password}}" stepKey="fillPassword"/>
2929
<click selector="{{AdminAdobeImsSignInSection.AdobeImsPasswordContinueButton}}" stepKey="clickPasswordContinue"/>
3030
<waitForPageLoad stepKey="waitForLoginToFinish"/>

app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminCreateUserWithoutPasswordActionGroup.xml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,38 @@
1515
<arguments>
1616
<argument name="role"/>
1717
<argument name="user" defaultValue="newAdmin"/>
18+
<argument name="password" type="string" defaultValue="{{_ENV.ADOBE_IMS_PASSWORD}}"/>
1819
</arguments>
1920

20-
<amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/>
21-
<waitForPageLoad stepKey="waitForUsersPage"/>
22-
<fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/>
23-
<fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{user.firstName}}" stepKey="enterFirstName"/>
24-
<fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{user.lastName}}" stepKey="enterLastName"/>
25-
<fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail"/>
26-
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
27-
<click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/>
28-
<click stepKey="chooseRole" selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}"/>
21+
<!--Open New Admin User Page. -->
22+
<amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewAdminUser"/>
23+
<waitForPageLoad stepKey="waitForNewAdminUserPage"/>
24+
25+
<!-- Fill admin user data. -->
26+
<fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{user.username}}" stepKey="enterAdminUserName"/>
27+
<fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{user.firstName}}" stepKey="enterAdminFirstName"/>
28+
<fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{user.lastName}}" stepKey="enterAdminLastName"/>
29+
<fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{user.username}}@magento.com" stepKey="enterAdminEmail"/>
30+
31+
<!-- Verify Current Admin User Identity via Adobe IMS. -->
32+
<click selector="{{AdminCreateUserSection.confirmIdentity}}" stepKey="clickConfirmIdentity"/>
33+
34+
<!-- Switch to Admin IMS Window. -->
35+
<switchToNextTab stepKey="switchToNextTab"/>
36+
<waitForElementVisible selector="{{AdminAdobeImsSignInSection.password}}" stepKey="waitForAdobeImsForm"/>
37+
<fillField selector="{{AdminCreateUserSection.password}}" userInput="{{password}}" stepKey="fillPassword"/>
38+
<click selector="{{AdminAdobeImsSignInSection.AdobeImsPasswordContinueButton}}" stepKey="clickPasswordContinue"/>
39+
<waitForElementNotVisible selector="{{AdminAdobeImsSignInSection.password}}" time="30" stepKey="waitForAdobeImsFormToDisappear"/>
40+
41+
<!-- Switch to Adobe Commerce Window. -->
42+
<switchToPreviousTab userInput="1" stepKey="switchPreviousTab"/>
43+
44+
<!-- Select Admin User Role. -->
45+
<click selector="{{AdminCreateUserSection.userRoleTab}}" stepKey="clickUserRole"/>
46+
<click selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}" stepKey="chooseRole"/>
47+
48+
<!-- Save admin user. -->
2949
<click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/>
3050
<waitForPageLoad stepKey="waitForSaveTheUser"/>
31-
<see userInput="You saved the user." stepKey="seeSuccessMessage"/>
3251
</actionGroup>
3352
</actionGroups>

app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminDisableAdobeImsActionGroup.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414
</annotations>
1515

1616
<magentoCLI command="admin:adobe-ims:disable" stepKey="disableAdminAdobeImsModule"/>
17-
<magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches1"/>
1817
</actionGroup>
1918
</actionGroups>

app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminEnableAdobeImsActionGroup.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414
</annotations>
1515

1616
<magentoCLI command="admin:adobe-ims:enable -o {{ClientCredentialsData.org_id}} -c {{ClientCredentialsData.client_id}} -s {{ClientCredentialsData.client_key}} -t yes" stepKey="enableAdminAdobeImsModule" />
17-
<magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches1"/>
1817
</actionGroup>
1918
</actionGroups>

app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminAdobeImsSignInSection.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<section name="AdminAdobeImsSignInSection">
1212
<element name="username" type="input" selector="#EmailPage-EmailField"/>
1313
<element name="password" type="input" selector="#PasswordPage-PasswordField"/>
14-
<element name="AdminAdobeImsSignInButton" type="button" selector=".adobe-ims-button button" timeout="30"/>
15-
<element name="AdobeImsUsernameContinueButton" type="button" selector="//button[@data-id='EmailPage-ContinueButton']" timeout="30"/>
14+
<element name="AdminAdobeImsSignInButton" type="button" selector=".adobe-ims-button button" timeout="15"/>
15+
<element name="AdobeImsUsernameContinueButton" type="button" selector="//button[@data-id='EmailPage-ContinueButton']" timeout="15"/>
1616
<element name="AdobeImsPasswordContinueButton" type="button" selector="//button[@data-id='PasswordPage-ContinueButton']"/>
17-
<element name="AdobeImsProfileSelect" type="text" selector="//div[contains(text(),'Personal Account')]" timeout="30"/>
17+
<element name="AdobeImsProfileSelect" type="text" selector="//div[contains(text(),'Personal Account')]" timeout="15"/>
1818
</section>
1919
</sections>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminCreateUserSection">
12+
<element name="confirmIdentity" type="button" selector="#user_ims_verification"/>
13+
<element name="password" type="input" selector="#PasswordPage-PasswordField"/>
14+
</section>
15+
</sections>

app/code/Magento/AdminAdobeIms/Test/Mftf/Test/CreateNewUserWithoutPasswordTest.xml renamed to app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminCreateNewAdminUserWithAdobeImsTest.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10-
<test name="CreateNewUserWithoutPasswordTest">
10+
<test name="AdminCreateNewAdminUserWithAdobeImsTest">
1111
<annotations>
1212
<features value="Backend"/>
13-
<stories value="Create a new admin user without password"/>
14-
<title value="Create a new admin user without password"/>
15-
<description value="Create a new admin user without password when AdminAdobeImsModule is enabled"/>
13+
<stories value="Create a new admin user with enabled Adobe IMS integration"/>
14+
<title value="Create a new admin user with enabled Adobe IMS integration"/>
15+
<description value="Create a new admin user when AdminAdobeImsModule is enabled"/>
1616
<severity value="CRITICAL"/>
1717
<group value="admin_ims"/>
18+
<testCaseId value="CABPI-227"/>
1819
<skip>
1920
<issueId value="AC-3153">Skipped</issueId>
2021
</skip>
21-
<testCaseId value="CABPI-227"/>
2222
</annotations>
2323
<before>
2424
<actionGroup ref="AdminEnableAdobeImsActionGroup" stepKey="enableAdminAdobeImsModule" />
@@ -33,5 +33,7 @@
3333
<argument name="user" value="activeAdmin"/>
3434
<argument name="role" value="roleDefaultAdministrator"/>
3535
</actionGroup>
36+
37+
<see userInput="You saved the user." stepKey="seeSuccessMessage"/>
3638
</test>
3739
</tests>

app/code/Magento/AdminAdobeIms/Test/Mftf/Test/CallbackWithoutCodeRedirectsToAdminLoginTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@
2222
</annotations>
2323
<before>
2424
<actionGroup ref="AdminEnableAdobeImsActionGroup" stepKey="enableIms" />
25-
<amOnPage url="{{AdminAdobeImsCallbackPage.url}}" stepKey="openCallbackUrl"/>
2625
</before>
2726
<after>
2827
<actionGroup ref="AdminDisableAdobeImsActionGroup" stepKey="disableAdminAdobeImsModule" />
2928
</after>
3029

30+
<!-- Open admin login page using callback URL with no code -->
31+
<amOnPage url="{{AdminAdobeImsCallbackPage.url}}" stepKey="openCallbackUrl"/>
3132
<waitForPageLoad stepKey="waitForAdminLoginPageLoad"/>
3233

33-
<!-- Check for Sign in with error message -->
34+
<!-- Check for the error message on login page -->
3435
<actionGroup ref="AssertAdminSignInEmptyCodeErrorMessageTestActionGroup"
3536
stepKey="assertAdminLoginShowsErrorMessage"/>
3637
</test>

app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/SearchResultApplier.php

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
namespace Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection;
88

9-
use Magento\Framework\Data\Collection;
10-
use Magento\Framework\Search\Adapter\Mysql\TemporaryStorage;
11-
use Magento\Framework\Search\Adapter\Mysql\TemporaryStorageFactory;
129
use Magento\Framework\Api\Search\SearchResultInterface;
10+
use Magento\Framework\Data\Collection;
1311

1412
/**
1513
* Resolve specific attributes for search criteria.
@@ -29,11 +27,6 @@ class SearchResultApplier implements SearchResultApplierInterface
2927
*/
3028
private $searchResult;
3129

32-
/**
33-
* @var TemporaryStorageFactory
34-
*/
35-
private $temporaryStorageFactory;
36-
3730
/**
3831
* @var array
3932
*/
@@ -42,18 +35,15 @@ class SearchResultApplier implements SearchResultApplierInterface
4235
/**
4336
* @param Collection $collection
4437
* @param SearchResultInterface $searchResult
45-
* @param TemporaryStorageFactory $temporaryStorageFactory
4638
* @param array $orders
4739
*/
4840
public function __construct(
4941
Collection $collection,
5042
SearchResultInterface $searchResult,
51-
TemporaryStorageFactory $temporaryStorageFactory,
5243
array $orders
5344
) {
5445
$this->collection = $collection;
5546
$this->searchResult = $searchResult;
56-
$this->temporaryStorageFactory = $temporaryStorageFactory;
5747
$this->orders = $orders;
5848
}
5949

@@ -62,21 +52,22 @@ public function __construct(
6252
*/
6353
public function apply()
6454
{
65-
$temporaryStorage = $this->temporaryStorageFactory->create();
66-
$table = $temporaryStorage->storeApiDocuments($this->searchResult->getItems());
55+
if (empty($this->searchResult->getItems())) {
56+
$this->collection->getSelect()->where('NULL');
57+
return;
58+
}
59+
$ids = [];
60+
foreach ($this->searchResult->getItems() as $item) {
61+
$ids[] = (int)$item->getId();
62+
}
6763

68-
$this->collection->getSelect()->joinInner(
69-
[
70-
'search_result' => $table->getName(),
71-
],
72-
'e.entity_id = search_result.' . TemporaryStorage::FIELD_ENTITY_ID,
73-
[]
74-
);
64+
$orderList = implode(',', $ids);
65+
$this->collection->getSelect()->where('e.entity_id IN (?)', $ids);
7566

7667
if (isset($this->orders['relevance'])) {
77-
$this->collection->getSelect()->order(
78-
'search_result.' . TemporaryStorage::FIELD_SCORE . ' ' . $this->orders['relevance']
79-
);
68+
$this->collection->getSelect()
69+
->reset(\Magento\Framework\DB\Select::ORDER)
70+
->order(new \Magento\Framework\DB\Sql\Expression("FIELD(e.entity_id, $orderList)"));
8071
}
8172
}
8273
}

app/code/Magento/Customer/Test/Mftf/Section/AdminCreateUserSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<element name="currentPasswordField" type="input" selector="#user_current_password"/>
2222
<element name="expireAtField" type="input" selector="#user_expires_at"/>
2323
<element name="createdRoleInUserPage" type="text" selector="//tr//td[contains(text(), '{{arg}}')]" parameterized="true"/>
24+
<element name="userInfoTab" type="button" selector="#page_tabs_main_section"/>
2425
<element name="userRoleTab" type="button" selector="#page_tabs_roles_section"/>
2526
<element name="saveButton" type="button" selector="#save"/>
2627
</section>

0 commit comments

Comments
 (0)