Skip to content

Commit 18c8f31

Browse files
committed
Customer Subscribes To Newsletter Subscription
1 parent 78bb169 commit 18c8f31

8 files changed

+150
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AssertStorefrontCustomerMessagesActionGroup">
12+
<arguments>
13+
<argument name="message" type="string"/>
14+
</arguments>
15+
16+
<waitForElementVisible selector="{{StorefrontCustomerMessagesSection.successMessage}}" stepKey="waitForElement"/>
17+
<see userInput="{{message}}" selector="{{StorefrontCustomerMessagesSection.successMessage}}" stepKey="seeMessage"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 21 additions & 0 deletions
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="StorefrontCustomerLoginActionGroup">
12+
<arguments>
13+
<argument name="customer" type="entity"/>
14+
</arguments>
15+
16+
<click selector="{{StorefrontPanelHeaderSection.customerLoginLink}}" stepKey="clickSignInLnk"/>
17+
<fillField selector="{{StorefrontCustomerLoginFormSection.emailField}}" userInput="{{customer.email}}" stepKey="fillEmailField"/>
18+
<fillField selector="{{StorefrontCustomerLoginFormSection.passwordField}}" userInput="{{customer.password}}" stepKey="fillPasswordField"/>
19+
<click selector="{{StorefrontCustomerLoginFormSection.signInAccountButton}}" stepKey="clickSignInButton"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="StorefrontCustomerNavigateToNewsletterPageActionGroup">
12+
<amOnPage url="{{StorefrontCustomerNewsletterManagePage.url}}" stepKey="goToNewsletterPage"/>
13+
<waitForPageLoad stepKey="waitForPageLoad"/>
14+
</actionGroup>
15+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="StorefrontCustomerUpdateGeneralSubscriptionActionGroup">
12+
<click selector="{{StorefrontCustomerNewsletterSection.newsletterCheckbox}}" stepKey="checkNewsLetterSubscriptionCheckbox"/>
13+
<click selector="{{StorefrontCustomerNewsletterSection.submit}}" stepKey="clickSubmitButton"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="StorefrontCustomerNewsletterManagePage" url="/newsletter/manage/" area="storefront" module="Magento_Customer">
12+
<section name="StorefrontCustomerNewsletterSection"/>
13+
</page>
14+
</pages>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontCustomerLoginFormSection">
12+
<element name="emailField" type="input" selector=".fieldset.login #email.input-text"/>
13+
<element name="passwordField" type="input" selector=".field.password.required #pass.input-text"/>
14+
<element name="signInAccountButton" type="button" selector=".actions-toolbar #send2.action.login.primary" timeout="30"/>
15+
</section>
16+
</sections>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontCustomerNewsletterSection">
12+
<element name="newsletterCheckbox" type="checkbox" selector="#subscription.checkbox"/>
13+
<element name="submit" type="button" selector=".action.save.primary"/>
14+
</section>
15+
</sections>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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="StorefrontCustomerSubscribeToNewsletterTest">
12+
<annotations>
13+
<features value="Newsletter Subscription"/>
14+
<stories value="Subscribe To Newsletter Subscription on StoreFront"/>
15+
<title value="StoreFront Customer Newsletter Subscription"/>
16+
<description value="Customer can be subscribed to Newsletter Subscription on StoreFront"/>
17+
</annotations>
18+
<before>
19+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
20+
</before>
21+
<after>
22+
<deleteData createDataKey="createCustomer" stepKey="deleteCreatedCustomer"/>
23+
</after>
24+
25+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/>
26+
<actionGroup ref="StorefrontCustomerLoginActionGroup" stepKey="loginAsCustomer">
27+
<argument name="customer" value="$$createCustomer$$"/>
28+
</actionGroup>
29+
<actionGroup ref="StorefrontCustomerNavigateToNewsletterPageActionGroup" stepKey="navigateToNewsletterPage"/>
30+
<actionGroup ref="StorefrontCustomerUpdateGeneralSubscriptionActionGroup" stepKey="subscribeToNewsletter"/>
31+
<actionGroup ref="AssertStorefrontCustomerMessagesActionGroup" stepKey="assertMessage">
32+
<argument name="message" value="We have saved your subscription."/>
33+
</actionGroup>
34+
</test>
35+
</tests>

0 commit comments

Comments
 (0)