Skip to content

Commit 93d5c34

Browse files
ENGCOM-8424: Resolve Login As Customer Log - Logged In must be DateRange Filter instead of Text filter, Date display wrong timezone issue30328 #30329
- Merge Pull Request #30329 from edenduong/magento2:2.4-bugfix/date_login_customer_issue30328 - Merged commits: 1. eeb47dd 2. b4f5784 3. 85b410d 4. 36472eb 5. 312d9d4 6. a16616b 7. 8ddd329 8. ef72f80 9. d372d2b 10. 3038e85 11. c8fb47e 12. 46aa750 13. 60b8981 14. a48886c 15. 1afe3db 16. 0fa2b89 17. 60ebbba 18. 6fb4052
2 parents 2e2af0a + 6fb4052 commit 93d5c34

File tree

4 files changed

+84
-3
lines changed

4 files changed

+84
-3
lines changed
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="AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup">
12+
<annotations>
13+
<description>Filter Login as Customer Log grid by current day.</description>
14+
</annotations>
15+
<click selector="{{AdminLoginAsCustomerLogToolbarSection.filters}}" stepKey="clickFilters"/>
16+
<click selector="{{AdminLoginAsCustomerLogToolbarSection.DatePickerFrom}}" stepKey="clickFromDate"/>
17+
<click selector="{{AdminLoginAsCustomerLogToolbarSection.todayDate}}" stepKey="clickToToday"/>
18+
<click selector="{{AdminLoginAsCustomerLogToolbarSection.DatePickerTo}}" stepKey="clickToDate"/>
19+
<click selector="{{AdminLoginAsCustomerLogToolbarSection.todayDate}}" stepKey="clickTodayDateAgain"/>
20+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
21+
</actionGroup>
22+
</actionGroups>

app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminLoginAsCustomerLogToolbarSection">
1212
<element name="search" type="button" selector="button[data-action='grid-filter-apply']"/>
13-
<element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']"/>
13+
<element name="filters" type="button" selector="button[data-action='grid-filter-expand']"/>
14+
<element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="15"/>
15+
<element name="DatePickerFrom" type="button" selector="[name='time[from]'] + button" timeout="15"/>
16+
<element name="DatePickerTo" type="button" selector="[name='time[to]'] + button" timeout="15"/>
17+
<element name="todayDate" type="button" selector=".ui-datepicker-today"/>
1418
</section>
1519
</sections>
1620

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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="AdminLoginAsCustomerLoggingFilterTest">
12+
<annotations>
13+
<features value="Login as Customer logs"/>
14+
<stories value="Filter by date login as customer logs"/>
15+
<title value="Filter by date login as customer logs"/>
16+
<description value="Filter by date should be from/to"/>
17+
<severity value="AVERAGE"/>
18+
<group value="login_as_customer"/>
19+
<testCaseId value="MC-38920"/>
20+
</annotations>
21+
<before>
22+
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1"
23+
stepKey="enableLoginAsCustomer"/>
24+
<magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0"
25+
stepKey="enableLoginAsCustomerAutoDetection"/>
26+
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createFirstCustomer"/>
27+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/>
28+
</before>
29+
<after>
30+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterAfter"/>
31+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsDefaultAdmin"/>
32+
<deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/>
33+
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0"
34+
stepKey="disableLoginAsCustomer"/>
35+
</after>
36+
<!-- Login into First Customer account -->
37+
<actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup"
38+
stepKey="loginAsFirstCustomerByDefaultAdmin">
39+
<argument name="customerId" value="$$createFirstCustomer.id$$"/>
40+
</actionGroup>
41+
<actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutFirstCustomerDefaultAdmin"/>
42+
<!-- Navigate to Login as Customer Log page -->
43+
<actionGroup ref="AdminOpenLoginAsCustomerLogActionGroup" stepKey="gotoLoginAsCustomerLog"/>
44+
<!-- Setup date filters -->
45+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/>
46+
<actionGroup ref="AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup" stepKey="filterByToday"/>
47+
<!-- Perform assertions -->
48+
<actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyDefaultAdminFirstCustomerLogRecord">
49+
<argument name="rowNumber" value="1"/>
50+
<argument name="adminId" value="1"/>
51+
<argument name="customerId" value="$$createFirstCustomer.id$$"/>
52+
</actionGroup>
53+
</test>
54+
</tests>

app/code/Magento/LoginAsCustomerLog/view/adminhtml/ui_component/login_as_customer_log_listing.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@
8383
<label translate="true">Admin Name</label>
8484
</settings>
8585
</column>
86-
<column name="time" sortOrder="60">
86+
<column name="time" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date" sortOrder="60">
8787
<settings>
88-
<filter>text</filter>
88+
<filter>dateRange</filter>
89+
<dataType>date</dataType>
8990
<label translate="true">Logged In</label>
9091
</settings>
9192
</column>

0 commit comments

Comments
 (0)