Skip to content

Commit bbf4bbc

Browse files
committed
Minor fixes for magento-commerce/magento-functional-tests-migration#638: Convert ValidateEmailOnCheckoutTest to MFTF
1 parent ae696ce commit bbf4bbc

10 files changed

+179
-60
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontClickAddToCartOnProductPageActionGroup">
11+
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart" />
12+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage" />
13+
</actionGroup>
14+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontEmailNoteMessageOnCheckoutActionGroup">
12+
<arguments>
13+
<argument name="message" type="string" defaultValue="You can create an account after checkout." />
14+
</arguments>
15+
<waitForElementVisible selector="{{StorefrontCheckoutCheckoutCustomerLoginSection.emailNoteMessage}}" stepKey="waitForFormValidation"/>
16+
<see selector="{{StorefrontCheckoutCheckoutCustomerLoginSection.emailNoteMessage}}" userInput="{{message}}" stepKey="seeTheNoteMessageIsDisplayed"/>
17+
</actionGroup>
18+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontEmailTooltipContentOnCheckoutActionGroup">
12+
<arguments>
13+
<argument name="content" type="string" defaultValue="We'll send your order confirmation here." />
14+
</arguments>
15+
<waitForElementVisible selector="{{StorefrontCheckoutCheckoutCustomerLoginSection.emailTooltipButton}}" stepKey="waitForTooltipButtonVisible" />
16+
<click selector="{{StorefrontCheckoutCheckoutCustomerLoginSection.emailTooltipButton}}" stepKey="clickEmailTooltipButton" />
17+
<see selector="{{StorefrontCheckoutCheckoutCustomerLoginSection.emailTooltipContent}}" userInput="{{content}}" stepKey="seeEmailTooltipContent" />
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontEmailValidationMessageOnCheckoutActionGroup">
12+
<arguments>
13+
<argument name="message" type="string" defaultValue="Please enter a valid email address (Ex: johndoe@domain.com)." />
14+
</arguments>
15+
<waitForElementVisible selector="{{StorefrontCheckoutCheckoutCustomerLoginSection.emailErrorMessage}}" stepKey="waitForFormValidation"/>
16+
<see selector="{{StorefrontCheckoutCheckoutCustomerLoginSection.emailErrorMessage}}" userInput="{{message}}" stepKey="seeTheErrorMessageIsDisplayed"/>
17+
</actionGroup>
18+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<argument name="paymentMethod" type="string"/>
111111
</arguments>
112112
<remove keyForRemoval="checkMessage"/>
113-
<dontsee selector="{{CheckoutPaymentSection.paymentMethodByName(paymentMethod)}}" parametrized="true" stepKey="paymentMethodDoesNotAvailable"/>
113+
<dontSee selector="{{CheckoutPaymentSection.paymentMethodByName(paymentMethod)}}" stepKey="paymentMethodDoesNotAvailable"/>
114114
</actionGroup>
115115
<!-- Logged in user checkout filling shipping section -->
116116
<actionGroup name="LoggedInUserCheckoutFillingShippingSectionActionGroup">
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontFillEmailFieldOnCheckoutActionGroup">
12+
<arguments>
13+
<argument name="email" type="string" />
14+
</arguments>
15+
<fillField selector="{{StorefrontCheckoutCheckoutCustomerLoginSection.email}}" userInput="{{email}}" stepKey="fillCustomerEmailField"/>
16+
<doubleClick selector="{{StorefrontCheckoutCheckoutCustomerLoginSection.emailTooltipButton}}" stepKey="clickToMoveFocusFromEmailInput" />
17+
<waitForPageLoad stepKey="waitForPageLoad" />
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontOpenCheckoutPageActionGroup">
11+
<amOnPage url="{{CheckoutPage.url}}" stepKey="openCheckoutPage" />
12+
<waitForPageLoad stepKey="waitForCheckoutPageLoaded" />
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontCheckoutCheckoutCustomerLoginSection">
12+
<element name="email" type="input" selector="form[data-role='email-with-possible-login'] input[name='username']" />
13+
<element name="emailNoteMessage" type="text" selector="//form[@data-role='email-with-possible-login']//div[input[@name='username']]//*[contains(@class, 'note')]" />
14+
<element name="emailErrorMessage" type="text" selector="//form[@data-role='email-with-possible-login']//div[input[@name='username']]//*[@id='customer-email-error']" />
15+
<element name="emailTooltipButton" type="button" selector="//form[@data-role='email-with-possible-login']//div[input[@name='username']]//*[contains(@class, 'action-help')]" />
16+
<element name="emailTooltipContent" type="text" selector="//form[@data-role='email-with-possible-login']//div[input[@name='username']]//*[contains(@class, 'field-tooltip-content')]" />
17+
<element name="password" type="input" selector="form[data-role='email-with-possible-login'] input[name='password']" />
18+
<element name="passwordNoteMessage" type="text" selector="//form[@data-role='email-with-possible-login']//div[input[@name='password']]//*[contains(@class, 'note')]" />
19+
<element name="submit" type="button" selector="form[data-role='email-with-possible-login'] button[type='submit']" />
20+
<element name="forgotPassword" type="button" selector="form[data-role='email-with-possible-login'] a.remind" />
21+
</section>
22+
</sections>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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="StorefrontValidateEmailOnCheckoutTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<title value="Email validation for Guest on checkout flow"/>
15+
<description value="Email validation for Guest on checkout flow"/>
16+
<stories value="Guest Checkout"/>
17+
<testCaseId value="MC-14695" />
18+
<group value="checkout"/>
19+
<group value="shoppingCart"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<createData entity="SimpleTwo" stepKey="simpleProduct"/>
24+
</before>
25+
26+
<after>
27+
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
28+
</after>
29+
30+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront">
31+
<argument name="productUrl" value="$$simpleProduct.custom_attributes[url_key]$$" />
32+
</actionGroup>
33+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage" />
34+
35+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage" />
36+
<actionGroup ref="AssertStorefrontEmailTooltipContentOnCheckoutActionGroup" stepKey="assertEmailTooltipContent" />
37+
<actionGroup ref="AssertStorefrontEmailNoteMessageOnCheckoutActionGroup" stepKey="assertEmailNoteMessage" />
38+
39+
<actionGroup ref="StorefrontFillEmailFieldOnCheckoutActionGroup" stepKey="fillIncorrectEmailFirstAttempt">
40+
<argument name="email" value="John" />
41+
</actionGroup>
42+
<actionGroup ref="AssertStorefrontEmailValidationMessageOnCheckoutActionGroup" stepKey="verifyValidationErrorMessageFirstAttempt" />
43+
44+
<actionGroup ref="StorefrontFillEmailFieldOnCheckoutActionGroup" stepKey="fillIncorrectEmailSecondAttempt">
45+
<argument name="email" value="johndoe#example.com" />
46+
</actionGroup>
47+
<actionGroup ref="AssertStorefrontEmailValidationMessageOnCheckoutActionGroup" stepKey="verifyValidationErrorMessageSecondAttempt" />
48+
49+
<actionGroup ref="StorefrontFillEmailFieldOnCheckoutActionGroup" stepKey="fillIncorrectEmailThirdAttempt">
50+
<argument name="email" value="johndoe@example.c" />
51+
</actionGroup>
52+
<actionGroup ref="AssertStorefrontEmailValidationMessageOnCheckoutActionGroup" stepKey="verifyValidationErrorMessageThirdAttempt" />
53+
</test>
54+
</tests>

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

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)