|
| 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="ValidateEmailOnCheckoutTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Checkout"/> |
| 14 | + <title value="Guest Checkout"/> |
| 15 | + <description value="Email validation for Guest on checkout flow"/> |
| 16 | + <stories value="Email validation for Guest on checkout flow"/> |
| 17 | + <group value="shoppingCart"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> |
| 22 | + </before> |
| 23 | + |
| 24 | + <!--Go to product page--> |
| 25 | + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/> |
| 26 | + <waitForPageLoad stepKey="waitForCatalogPageLoad"/> |
| 27 | + |
| 28 | + <!--Add Product to Shopping Cart--> |
| 29 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> |
| 30 | + <argument name="productName" value="$$createSimpleProduct.name$$"/> |
| 31 | + </actionGroup> |
| 32 | + |
| 33 | + <!--Go to Checkout--> |
| 34 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> |
| 35 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask1"/> |
| 36 | + |
| 37 | + <!--Fill in the form fields for 1st variation, and check the validation message--> |
| 38 | + <fillField selector="{{CheckoutShippingSection.email}}" userInput="johndoe" stepKey="setCustomerEmailVariation1"/> |
| 39 | + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="John" stepKey="SetCustomerFirstNameVariation1"/> |
| 40 | + <waitForPageLoad stepKey="waitforFormValidation1"/> |
| 41 | + <see userInput="Please enter a valid email address (Ex: johndoe@domain.com)." stepKey="seeTheErrorMessageIsDisplayed1"/> |
| 42 | + |
| 43 | + <!--Fill in the form fields for 2nd variation, and check the validation message--> |
| 44 | + <fillField selector="{{CheckoutShippingSection.email}}" userInput="johndoe#example.com" stepKey="setCustomerEmailVariation2"/> |
| 45 | + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="John" stepKey="SetCustomerFirstNameVariation2"/> |
| 46 | + <waitForPageLoad stepKey="waitForFormValidation2"/> |
| 47 | + <see userInput="Please enter a valid email address (Ex: johndoe@domain.com)." stepKey="seeTheErrorMessageIsDisplayed2"/> |
| 48 | + |
| 49 | + <!--Fill in the form fields for 3rd variation, and check the validation message--> |
| 50 | + <fillField selector="{{CheckoutShippingSection.email}}" userInput="johndoe@example.c" stepKey="setCustomerEmailVariation3"/> |
| 51 | + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="John" stepKey="SetCustomerFirstNameVariation3"/> |
| 52 | + <waitForPageLoad stepKey="waitForFormValidation3"/> |
| 53 | + <see userInput="Please enter a valid email address (Ex: johndoe@domain.com)." stepKey="seeTheErrorMessageIsDisplayed3"/> |
| 54 | + |
| 55 | + <after> |
| 56 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 57 | + </after> |
| 58 | + </test> |
| 59 | +</tests> |
0 commit comments