Skip to content

Commit c189186

Browse files
authored
ENGCOM-9033: MFTF: Admin Login As Customer - Change Account Information Test #31100
2 parents 5493088 + 32f9377 commit c189186

File tree

4 files changed

+101
-0
lines changed

4 files changed

+101
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AssertStorefrontCustomerAccountInformation">
12+
<arguments>
13+
<argument name="firstName" type="string" defaultValue=""/>
14+
<argument name="lastName" type="string" defaultValue=""/>
15+
<argument name="email" type="string" defaultValue=""/>
16+
</arguments>
17+
<see userInput="{{firstName}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" stepKey="seeFirstName"/>
18+
<see userInput="{{lastName}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" stepKey="seeLastName"/>
19+
<see userInput="{{email}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" stepKey="seeEmail"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="StorefrontCustomerChangeAccountInformationActionGroup">
12+
<annotations>
13+
<description>Change the Customer First and Last name via the Storefront Customer Dashboard page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="firstName" type="string"/>
17+
<argument name="lastName" type="string"/>
18+
</arguments>
19+
20+
<conditionalClick selector="{{StorefrontCustomerSidebarSection.sidebarTab('Account Information')}}" dependentSelector="{{StorefrontCustomerSidebarSection.sidebarTab('Account Information')}}" visible="true" stepKey="openAccountInfoTab"/>
21+
<waitForPageLoad stepKey="waitForAccountInfoTabOpened"/>
22+
<fillField selector="{{StorefrontCustomerAccountInformationSection.firstName}}" userInput="{{firstName}}" stepKey="fillFirstName"/>
23+
<fillField selector="{{StorefrontCustomerAccountInformationSection.lastName}}" userInput="{{lastName}}" stepKey="fillLastName"/>
24+
<click selector="{{StorefrontCustomerAccountInformationSection.saveButton}}" stepKey="saveChange"/>
25+
<waitForPageLoad stepKey="waitForPageLoaded"/>
26+
</actionGroup>
27+
</actionGroups>

app/code/Magento/LoginAsCustomer/Test/Mftf/Data/CustomerData.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@
1414
<entity name="Simple_US_CA_Customer_Assistance_Allowed" type="customer" extends="Simple_US_CA_Customer">
1515
<requiredEntity type="customer_extension_attribute">AssistanceAllowed</requiredEntity>
1616
</entity>
17+
<entity name="Simple_UKCustomer_Assistance_Allowed" type="customer" extends="UKCustomer">
18+
</entity>
1719
</entities>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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="AdminLoginAsCustomerChangeAccountInformationTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Edit Customer Account Information"/>
15+
<title value="Admin user login as customer and edit customer's first and last name"/>
16+
<description value="Verify Admin can access customer's personal cabinet and change his first and last name using Login as Customer functionality"/>
17+
<group value="login_as_customer"/>
18+
<severity value="MINOR"></severity>
19+
</annotations>
20+
<before>
21+
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/>
22+
<magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/>
23+
<magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/>
24+
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/>
25+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAdmin"/>
26+
</before>
27+
<after>
28+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/>
29+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
30+
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/>
31+
<magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/>
32+
</after>
33+
34+
<actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup"
35+
stepKey="loginAsCustomerFromCustomerPage">
36+
<argument name="customerId" value="$$createCustomer.id$$"/>
37+
</actionGroup>
38+
<actionGroup ref="StorefrontCustomerChangeAccountInformationActionGroup" stepKey="editAccountInfo">
39+
<argument name="firstName" value="{{UKCustomer.firstname}}"/>
40+
<argument name="lastName" value="{{UKCustomer.lastname}}"/>
41+
</actionGroup>
42+
<actionGroup ref="AssertStorefrontCustomerMessagesActionGroup" stepKey="assertSuccessMessage">
43+
<argument name="message" value="You saved the account information."/>
44+
</actionGroup>
45+
<actionGroup ref="AssertStorefrontCustomerAccountInformation" stepKey="assertAccountInformation">
46+
<argument name="firstName" value="{{UKCustomer.firstname}}"/>
47+
<argument name="lastName" value="{{UKCustomer.lastname}}"/>
48+
<argument name="email" value="$createCustomer.email$"/>
49+
</actionGroup>
50+
</test>
51+
</tests>

0 commit comments

Comments
 (0)