Skip to content

Commit 5977fe4

Browse files
author
Anna Bukatar
committed
MC-42592: Inconsistent customer email validation on frontend
1 parent f121ac8 commit 5977fe4

File tree

2 files changed

+67
-5
lines changed

2 files changed

+67
-5
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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="OnePageCheckoutWithSignInLinkForEmailVerificationlTest">
12+
<annotations>
13+
<features value="OnePageCheckout"/>
14+
<title value="OnePageCheckout with sign in link for email verification test"/>
15+
<description value="Verify that error message is correct for invalid a email entered with 'Sign in' form"/>
16+
<severity value="MINOR"/>
17+
<testCaseId value="MC-42592"/>
18+
<group value="checkout"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<!-- Create Simple Product -->
23+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct">
24+
<field key="price">560</field>
25+
</createData>
26+
</before>
27+
<after>
28+
<!-- Delete created product -->
29+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
30+
</after>
31+
32+
<!-- Add Simple Product to cart -->
33+
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/>
34+
<waitForPageLoad stepKey="waitForSimpleProductPageLoad"/>
35+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
36+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
37+
</actionGroup>
38+
39+
<!-- Go to shopping cart -->
40+
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/>
41+
<actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm">
42+
<argument name="address" value="US_Address_CA"/>
43+
</actionGroup>
44+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
45+
<comment userInput="Adding the comment to replace waitForProceedToCheckout action for preserving Backward Compatibility" stepKey="waitForProceedToCheckout"/>
46+
47+
<!-- Try to login using invalid email and Sign In link from checkout page -->
48+
<actionGroup ref="LoginAsCustomerUsingSignInLinkActionGroup" stepKey="customerLogin">
49+
<argument name="customerEmail" value="invalid @example.com"/>
50+
<argument name="customerPwd" value="Password123"/>
51+
</actionGroup>
52+
53+
<!-- Assert that error message is correct -->
54+
<actionGroup ref="StorefrontFillEmailFieldOnCheckoutActionGroup" stepKey="fillIncorrectEmailForthAttempt">
55+
<argument name="email" value="invalid @example.com"/>
56+
</actionGroup>
57+
<actionGroup ref="AssertStorefrontEmailValidationMessageOnCheckoutActionGroup" stepKey="verifyValidationErrorMessageForthAttempt"/>
58+
</test>
59+
</tests>

app/code/Magento/Checkout/view/frontend/web/template/authentication.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,21 @@
4242
<div class="block-content" aria-labelledby="block-customer-login-heading">
4343
<form data-role="login"
4444
data-bind="submit:login"
45-
method="post">
45+
method="post"
46+
novalidate="novalidate">
4647
<div class="fieldset"
4748
data-bind="attr: {'data-hasrequired': $t('* Required Fields')}">
4849
<div class="field field-email required">
4950
<label class="label" for="login-email"><span data-bind="i18n: 'Email Address'"></span></label>
5051
<div class="control">
51-
<input type="email"
52+
<input name="username"
53+
id="customer-email"
54+
type="email"
5255
class="input-text"
53-
id="login-email"
54-
name="username"
56+
data-mage-init='{"mage/trim-input":{}}'
5557
data-bind="attr: {autocomplete: autocomplete}"
56-
data-validate="{required:true, 'validate-email':true}" />
58+
data-validate="{required:true, 'validate-email':true}"
59+
>
5760
</div>
5861
</div>
5962
<div class="field field-password required">

0 commit comments

Comments
 (0)