Skip to content

Commit cb0da21

Browse files
author
Anna Bukatar
committed
MC-42592: Inconsistent customer email validation on frontend
- Fixed CR issued
1 parent 8e0a9a8 commit cb0da21

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithSignInLinkForEmailVerificationTest.xml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="OnePageCheckoutWithSignInLinkForEmailVerificationlTest">
11+
<test name="OnePageCheckoutWithSignInLinkForEmailVerificationTest">
1212
<annotations>
1313
<features value="OnePageCheckout"/>
1414
<title value="OnePageCheckout with sign in link for email verification test"/>
1515
<description value="Verify that error message is correct for invalid a email entered with 'Sign in' form"/>
1616
<severity value="MINOR"/>
17-
<testCaseId value="MC-42592"/>
17+
<testCaseId value="MC-42729"/>
1818
<group value="checkout"/>
1919
<group value="mtf_migrated"/>
2020
</annotations>
@@ -38,22 +38,16 @@
3838

3939
<!-- Go to shopping cart -->
4040
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/>
41-
<actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm">
42-
<argument name="address" value="US_Address_CA"/>
43-
</actionGroup>
4441
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
4542
<comment userInput="Adding the comment to replace waitForProceedToCheckout action for preserving Backward Compatibility" stepKey="waitForProceedToCheckout"/>
4643

4744
<!-- 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>
45+
<click selector="{{StorefrontCustomerSignInLinkSection.signInLink}}" stepKey="clickOnCustomizeAndAddToCartButton"/>
46+
<fillField selector="{{StorefrontCustomerSignInLinkSection.email}}" userInput="invalid @example.com" stepKey="fillEmail"/>
47+
<fillField selector="{{StorefrontCustomerSignInLinkSection.password}}" userInput="Password123" stepKey="fillPassword"/>
48+
<click selector="{{StorefrontCustomerSignInLinkSection.signInBtn}}" stepKey="clickSignInBtn"/>
5249

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"/>
50+
<waitForElementVisible selector="#login-email-error" stepKey="waitForFormValidation"/>
51+
<see selector="#login-email-error" userInput="Please enter a valid email address (Ex: johndoe@domain.com)." stepKey="seeTheCorrectErrorMessageIsDisplayed"/>
5852
</test>
5953
</tests>

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@
5050
<label class="label" for="login-email"><span data-bind="i18n: 'Email Address'"></span></label>
5151
<div class="control">
5252
<input name="username"
53-
id="customer-email"
53+
id="login-email"
5454
type="email"
5555
class="input-text"
56-
data-mage-init='{"mage/trim-input":{}}'
5756
data-bind="attr: {autocomplete: autocomplete}"
5857
data-validate="{required:true, 'validate-email':true}"
59-
>
58+
/>
6059
</div>
6160
</div>
6261
<div class="field field-password required">

0 commit comments

Comments
 (0)