Skip to content

Commit 4f0a514

Browse files
magento2-login-as-customer/issues/35: "Verify that 'Login As Customer Log' not shown if 'Login as customer' functionality is disabled" test added.
1 parent d946b9e commit 4f0a514

File tree

5 files changed

+94
-0
lines changed

5 files changed

+94
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<!-- Verify Login As Customer is absent in admin menu -->
12+
<actionGroup name="AdminLoginAsCustomerLogAbsentInMenuActionGroup">
13+
<click selector="{{AdminMenuSection.menuItem(AdminMenuCustomers.dataUiId)}}" stepKey="clickOnCustomersMenuItem"/>
14+
<dontSeeElement selector="{{AdminMenuSection.menuItem(AdminMenuLoginAsCustomer.dataUiId)}}" stepKey="dontSeeLoginAsCustomerLog"/>
15+
</actionGroup>
16+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<!-- Verify Login As Customer is not available by direct url -->
12+
<actionGroup name="AdminLoginAsCustomerLogPageNotAvailableActionGroup">
13+
<amOnPage url="{{AdminLoginAsCustomerLogPage.url}}" stepKey="openAdminLoginAsCustomerLogPage"/>
14+
<see selector="{{AdminHeaderSection.pageHeading}}" userInput="404 Error" stepKey="see404PageHeading"/>
15+
</actionGroup>
16+
</actionGroups>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="AdminMenuLoginAsCustomer">
12+
<data key="pageTitle">Login As Customer Log</data>
13+
<data key="title">Login As Customer Log</data>
14+
<data key="dataUiId">magento-loginascustomer-login-log</data>
15+
</entity>
16+
</entities>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:/Page/etc/PageObject.xsd">
11+
<page name="AdminLoginAsCustomerLogPage" url="admin/loginascustomer/login/" area="admin" module="Magento_LoginAsCustomer"/>
12+
</pages>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest">
12+
<annotations>
13+
<features value="Login As Customer"/>
14+
<stories value="Availability of UI elements if module enable/disable"/>
15+
<title value="'Login As Customer Log' not shown if 'Login as customer' functionality is disabled"/>
16+
<description value="Verify that 'Login As Customer Log' not shown if 'Login as customer' functionality is disabled"/>
17+
<severity value="CRITICAL"/>
18+
<group value="login_as_customer"/>
19+
</annotations>
20+
<before>
21+
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/>
22+
<magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/>
23+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
24+
</before>
25+
<after>
26+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
27+
</after>
28+
<!-- Verify Login As Customer Log is absent in admin menu -->
29+
<actionGroup ref="AdminLoginAsCustomerLogAbsentInMenuActionGroup" stepKey="verifyLoginAsCustomerLogAbsentInMenu"/>
30+
31+
<!-- Verify Login As Customer Log is not available by direct url -->
32+
<actionGroup ref="AdminLoginAsCustomerLogPageNotAvailableActionGroup" stepKey="verifyLoginAsCustomerLogNotAvailable"/>
33+
</test>
34+
</tests>

0 commit comments

Comments
 (0)