Skip to content

Commit

Permalink
ENGCOM-8424: Resolve Login As Customer Log - Logged In must be DateRa…
Browse files Browse the repository at this point in the history
…nge Filter instead of Text filter, Date display wrong timezone issue30328 #30329
  • Loading branch information
gabrieldagama committed Feb 25, 2021
2 parents 1c99799 + 93d5c34 commit 1def3d4
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup">
<annotations>
<description>Filter Login as Customer Log grid by current day.</description>
</annotations>
<click selector="{{AdminLoginAsCustomerLogToolbarSection.filters}}" stepKey="clickFilters"/>
<click selector="{{AdminLoginAsCustomerLogToolbarSection.DatePickerFrom}}" stepKey="clickFromDate"/>
<click selector="{{AdminLoginAsCustomerLogToolbarSection.todayDate}}" stepKey="clickToToday"/>
<click selector="{{AdminLoginAsCustomerLogToolbarSection.DatePickerTo}}" stepKey="clickToDate"/>
<click selector="{{AdminLoginAsCustomerLogToolbarSection.todayDate}}" stepKey="clickTodayDateAgain"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminLoginAsCustomerLogToolbarSection">
<element name="search" type="button" selector="button[data-action='grid-filter-apply']"/>
<element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']"/>
<element name="filters" type="button" selector="button[data-action='grid-filter-expand']"/>
<element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="15"/>
<element name="DatePickerFrom" type="button" selector="[name='time[from]'] + button" timeout="15"/>
<element name="DatePickerTo" type="button" selector="[name='time[to]'] + button" timeout="15"/>
<element name="todayDate" type="button" selector=".ui-datepicker-today"/>
</section>
</sections>

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminLoginAsCustomerLoggingFilterTest">
<annotations>
<features value="Login as Customer logs"/>
<stories value="Filter by date login as customer logs"/>
<title value="Filter by date login as customer logs"/>
<description value="Filter by date should be from/to"/>
<severity value="AVERAGE"/>
<group value="login_as_customer"/>
<testCaseId value="MC-38920"/>
</annotations>
<before>
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1"
stepKey="enableLoginAsCustomer"/>
<magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0"
stepKey="enableLoginAsCustomerAutoDetection"/>
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createFirstCustomer"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/>
</before>
<after>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterAfter"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsDefaultAdmin"/>
<deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/>
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0"
stepKey="disableLoginAsCustomer"/>
</after>
<!-- Login into First Customer account -->
<actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup"
stepKey="loginAsFirstCustomerByDefaultAdmin">
<argument name="customerId" value="$$createFirstCustomer.id$$"/>
</actionGroup>
<actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutFirstCustomerDefaultAdmin"/>
<!-- Navigate to Login as Customer Log page -->
<actionGroup ref="AdminOpenLoginAsCustomerLogActionGroup" stepKey="gotoLoginAsCustomerLog"/>
<!-- Setup date filters -->
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/>
<actionGroup ref="AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup" stepKey="filterByToday"/>
<!-- Perform assertions -->
<actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyDefaultAdminFirstCustomerLogRecord">
<argument name="rowNumber" value="1"/>
<argument name="adminId" value="1"/>
<argument name="customerId" value="$$createFirstCustomer.id$$"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@
<label translate="true">Admin Name</label>
</settings>
</column>
<column name="time" sortOrder="60">
<column name="time" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date" sortOrder="60">
<settings>
<filter>text</filter>
<filter>dateRange</filter>
<dataType>date</dataType>
<label translate="true">Logged In</label>
</settings>
</column>
Expand Down

0 comments on commit 1def3d4

Please sign in to comment.