Skip to content

MFTF: Extract Action Groups to separate files - magento/module-newsletter #25818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="CheckSubscribedNewsletterActionGroup">
<annotations>
<description>Goes to the Storefront Newsletter Management page. Validates that the 'Subscription' checkbox is checked.</description>
</annotations>

<amOnPage url="{{StorefrontNewsletterManagePage.url}}" stepKey="goToNewsletterManage"/>
<seeCheckboxIsChecked selector="{{StorefrontNewsletterManageSection.subscriptionCheckbox}}" stepKey="checkSubscribedNewsletter"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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">
<!--Create an Account. Check Sign Up for Newsletter checkbox -->
<actionGroup name="StorefrontCreateNewAccountNewsletterCheckedActionGroup" extends="SignUpNewUserFromStorefrontActionGroup">
<annotations>
<description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Clicks on 'Sign Up for Newsletter'. Validates that the Subscription Confirmation message is present and correct.</description>
</annotations>

<click selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="selectSignUpForNewsletterCheckbox" after="fillLastName"/>
<see stepKey="seeDescriptionNewsletter" userInput='You are subscribed to "General Subscription".' selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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="StorefrontCreateNewAccountNewsletterUncheckedActionGroup" extends="SignUpNewUserFromStorefrontActionGroup">
<annotations>
<description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Validates that the you are NOT subscribed message is present and correct.</description>
</annotations>
<arguments>
<argument name="Customer"/>
<argument name="Store"/>
</arguments>

<amOnPage stepKey="amOnStorefrontPage" url="{{Store.code}}"/>
<see stepKey="seeDescriptionNewsletter" userInput="You aren't subscribed to our newsletter." selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/>
<see stepKey="seeThankYouMessage" userInput="Thank you for registering with NewStore."/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@
*/
-->

<!--
NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore.
Please find the Comment with proper replacement for each of ActionGroups provided.
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<!--Create an Account. Check Sign Up for Newsletter checkbox -->
<actionGroup name="StorefrontCreateNewAccountNewsletterChecked" extends="SignUpNewUserFromStorefrontActionGroup">
<annotations>
<description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Clicks on 'Sign Up for Newsletter'. Validates that the Subscription Confirmation message is present and correct.</description>
</annotations>

<!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCreateNewAccountNewsletterCheckedActionGroup` instead -->
<click selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="selectSignUpForNewsletterCheckbox" after="fillLastName"/>
<see stepKey="seeDescriptionNewsletter" userInput='You are subscribed to "General Subscription".' selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/>
</actionGroup>

<!--Create an Account. Uncheck Sign Up for Newsletter checkbox -->
<actionGroup name="StorefrontCreateNewAccountNewsletterUnchecked" extends="SignUpNewUserFromStorefrontActionGroup">
<annotations>
<description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Validates that the you are NOT subscribed message is present and correct.</description>
Expand All @@ -28,18 +31,9 @@
<argument name="Store"/>
</arguments>

<!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCreateNewAccountNewsletterUncheckedActionGroup` instead -->
<amOnPage stepKey="amOnStorefrontPage" url="{{Store.code}}"/>
<see stepKey="seeDescriptionNewsletter" userInput="You aren't subscribed to our newsletter." selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/>
<see stepKey="seeThankYouMessage" userInput="Thank you for registering with NewStore."/>
</actionGroup>

<!--Check Subscribed Newsletter via StoreFront-->
<actionGroup name="CheckSubscribedNewsletterActionGroup">
<annotations>
<description>Goes to the Storefront Newsletter Management page. Validates that the 'Subscription' checkbox is checked.</description>
</annotations>

<amOnPage url="{{StorefrontNewsletterManagePage.url}}" stepKey="goToNewsletterManage"/>
<seeCheckboxIsChecked selector="{{StorefrontNewsletterManageSection.subscriptionCheckbox}}" stepKey="checkSubscribedNewsletter"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
</after>

<!--Go to store front (default) and click Create an Account.-->
<actionGroup ref="StorefrontCreateNewAccountNewsletterChecked" stepKey="SignUpNewUser">
<actionGroup ref="StorefrontCreateNewAccountNewsletterCheckedActionGroup" stepKey="SignUpNewUser">
<argument name="Customer" value="CustomerEntityOne"/>
</actionGroup>
<!--Sign Out-->
<amOnPage url="customer/account/logout/" stepKey="customerOnLogoutPage"/>
<waitForPageLoad stepKey="waitLogoutCustomer"/>
<!--Create new Account with the same email address. (unchecked Sign Up for Newsletter checkbox)-->
<actionGroup ref="StorefrontCreateNewAccountNewsletterUnchecked" stepKey="createNewAccountNewsletterUnchecked">
<actionGroup ref="StorefrontCreateNewAccountNewsletterUncheckedActionGroup" stepKey="createNewAccountNewsletterUnchecked">
<argument name="Customer" value="CustomerEntityOne"/>
<argument name="Store" value="staticStore"/>
</actionGroup>
Expand Down