Skip to content

Commit affcbe9

Browse files
magento2-login-as-customer/issues/44: "Admin user login as customer and make subscription to newsletter" test added.
1 parent f09dbd2 commit affcbe9

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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="AdminLoginAsCustomerSubscribeToNewsletterTest">
12+
<annotations>
13+
<features value="Login As Customer"/>
14+
<stories value="Subscribe to newsletter"/>
15+
<title value="Admin user login as customer and make subscription to newsletter"/>
16+
<description
17+
value="Verify that Admin can subscribe to newsletter using Login As Customer functionality"/>
18+
<severity value="AVERAGE"/>
19+
<group value="login_as_customer"/>
20+
</annotations>
21+
<before>
22+
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1"
23+
stepKey="enableLoginAsCustomer"/>
24+
<magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/>
25+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
26+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
27+
</before>
28+
<after>
29+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
30+
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0"
31+
stepKey="disableLoginAsCustomer"/>
32+
<magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/>
33+
</after>
34+
35+
<!-- Admin Login As Customer from Customer page -->
36+
<actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup"
37+
stepKey="lLoginAsCustomerFromCustomerPage">
38+
<argument name="customerId" value="$$createCustomer.id$$"/>
39+
</actionGroup>
40+
41+
<!-- Subscribe for newsletter -->
42+
<amOnPage url="{{StorefrontNewsletterManagePage.url}}" stepKey="goToNewsletterManage"/>
43+
<click selector="{{StorefrontNewsletterManageSection.subscriptionCheckbox}}"
44+
stepKey="checkSubscribedNewsletter"/>
45+
<click selector="{{StorefrontNewsletterManageSection.saveButton}}"
46+
stepKey="saveSubscription"/>
47+
<waitForPageLoad stepKey="waitForSubscriptionSaved"/>
48+
<actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAfterLoggedInAsCustomer"/>
49+
50+
<!-- Verify subscription successful -->
51+
<amOnPage url="{{AdminNewsletterSubscriberPage.url}}" stepKey="goToNewsletterSubscriberGrid"/>
52+
<see selector="{{AdminNewsletterSubscriberGridSection.email('1')}}" userInput="$$createCustomer.email$$" stepKey="seeCustomerEmailInSubscriberGrid"/>
53+
<see selector="{{AdminNewsletterSubscriberGridSection.type('1')}}" userInput="Customer" stepKey="seeCustomerTypeInSubscriberGrid"/>
54+
</test>
55+
</tests>

0 commit comments

Comments
 (0)