Skip to content
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

MFTF: Storefront Contact Us Form Submitting #29037

Open
wants to merge 9 commits into
base: 2.4-develop
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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="AssertStorefrontContactUsInvalidEmailActionGroup">
<arguments>
<argument name="message" type="string"/>
</arguments>
<see userInput="{{message}}" selector="{{StorefrontContactUsMessagesSection.errorEmailMessage}}" stepKey="errorMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontContactUsMessagesSection">
<element name="messageByType" type="block" selector="#maincontent .message-{{messageType}}" parameterized="true" />
<element name="messageByType" type="block" selector="#maincontent .message-{{messageType}}" parameterized="true"/>
<element name="errorEmailMessage" type="input" selector="#email-error.mage-error"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontSubmitContactUsFormFailedTest">
<annotations>
<features value="Contact"/>
<stories value="Storefront: Contact Us Form"/>
<title value="Submitting Contact Us Form on Storefront with invalid user input"/>
<description value="User should have no possibility submit Contact Form if input data is not valid"/>
<group value="contact"/>
<severity value="MINOR"></severity>
<testCaseId value="MC-35813"/>
</annotations>

<actionGroup ref="StorefrontOpenContactUsPageActionGroup" stepKey="navigateContactUsPage"/>
<actionGroup ref="StorefrontFillContactUsFormActionGroup" stepKey="fillContactUsForm">
<argument name="customer" value="Simple_Customer_With_Invalid_Email"/>
<argument name="contactUsData" value="DefaultContactUsData"/>
</actionGroup>
<actionGroup ref="StorefrontSubmitContactUsFormActionGroup" stepKey="submitContactUsForm"/>
<actionGroup ref="AssertStorefrontContactUsInvalidEmailActionGroup" stepKey="assertErrorMessage">
<argument name="message" value="Please enter a valid email address (Ex: johndoe@domain.com)."/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontSubmitContactUsFormSuccessTest">
<annotations>
<features value="Contact"/>
<stories value="Storefront Contact Us Form"/>
<title value="Submitting Contact Us Form on Storefront"/>
<description value="User should be able successfully submit Contact Us form, if input data is valid"/>
<group value="contact"/>
<severity value="MINOR"></severity>
<testCaseId value="MC-35815"/>
</annotations>

<actionGroup ref="StorefrontOpenContactUsPageActionGroup" stepKey="navigateContactUsPage"/>
<actionGroup ref="StorefrontFillContactUsFormActionGroup" stepKey="fillContactUsForm">
<argument name="customer" value="Simple_US_Customer"/>
<argument name="contactUsData" value="DefaultContactUsData"/>
</actionGroup>
<actionGroup ref="StorefrontSubmitContactUsFormActionGroup" stepKey="submitContactUsForm"/>
<actionGroup ref="AssertMessageContactUsFormActionGroup" stepKey="assertSuccessMessage"/>
</test>
</tests>
14 changes: 14 additions & 0 deletions app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,20 @@
<requiredEntity type="address">US_Address_CA</requiredEntity>
<requiredEntity type="address">US_Address_NY_Not_Default_Address</requiredEntity>
</entity>
<entity name="Simple_Customer_With_Invalid_Email" type="customer">
<data key="group_id">1</data>
<data key="default_billing">true</data>
<data key="default_shipping">true</data>
<data key="email" unique="prefix">John.Doe@</data>
<data key="firstname">John</data>
<data key="lastname">Doe</data>
<data key="fullname">John Doe</data>
<data key="password">pwdTest123!</data>
<data key="store_id">0</data>
<data key="website_id">0</data>
<data key="group">General</data>
<requiredEntity type="address">US_Address_TX</requiredEntity>
</entity>
<entity name="Customer_UK_US" type="customer" extends="Simple_GB_Customer">
<data key="country">United Kingdom</data>
<requiredEntity type="address">UK_With_State_Default_Billing</requiredEntity>
Expand Down