Skip to content

Commit 35b4cf5

Browse files
authored
ENGCOM-8543: [MFTF] Refactoring of CaptchaWithDisabledGuestCheckoutTest #30803
2 parents 12eb8cd + 9fa231d commit 35b4cf5

File tree

2 files changed

+54
-20
lines changed

2 files changed

+54
-20
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AssertStorefrontCaptchaVisibleOnCustomerSignInPopupActionGroup">
12+
<annotations>
13+
<description>Validate that the Captcha IS present on the Storefront Customer Sign In Popup.</description>
14+
</annotations>
15+
16+
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaField}}" stepKey="waitToSeeCaptchaField"/>
17+
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaImg}}" stepKey="waitToSeeCaptchaImage"/>
18+
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaReload}}" stepKey="waitToSeeCaptchaReloadButton"/>
19+
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaWithDisabledGuestCheckoutTest.xml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="CaptchaWithDisabledGuestCheckoutTest">
1111
<annotations>
1212
<features value="Captcha"/>
@@ -33,29 +33,42 @@
3333
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
3434
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct1"/>
3535
</after>
36-
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage"/>
37-
<waitForPageLoad stepKey="waitForPageLoad"/>
36+
37+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
38+
<argument name="productUrl" value="$$createSimpleProduct.sku$$"/>
39+
</actionGroup>
40+
41+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad"/>
3842
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
39-
<waitForText userInput="You added $$createSimpleProduct.name$$ to your shopping cart." stepKey="waitForText"/>
40-
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickCart"/>
41-
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/>
42-
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.email}}" stepKey="waitEmailFieldVisible"/>
43-
<fillField selector="{{StorefrontCustomerSignInPopupFormSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail"/>
44-
<fillField selector="{{StorefrontCustomerSignInPopupFormSection.password}}" userInput="incorrectPassword" stepKey="fillIncorrectCustomerPassword"/>
45-
<click selector="{{StorefrontCustomerSignInPopupFormSection.signIn}}" stepKey="clickSignIn"/>
43+
44+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForText"/>
45+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCart"/>
46+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout"/>
47+
48+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitEmailFieldVisible"/>
49+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillCustomerEmail"/>
50+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillIncorrectCustomerPassword"/>
51+
<actionGroup ref="StorefrontCustomerSignInPopUpActionGroup" stepKey="clickSignIn">
52+
<argument name="customerEmail" value="{{Simple_US_Customer.email}}"/>
53+
<argument name="customerPwd" value="incorrectPassword"/>
54+
</actionGroup>
55+
4656
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.errorMessage}}" stepKey="seeErrorMessage"/>
47-
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaField}}" stepKey="seeCaptchaField"/>
48-
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaImg}}" stepKey="seeCaptchaImage"/>
49-
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaReload}}" stepKey="seeCaptchaReloadButton"/>
57+
58+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeCaptchaField"/>
59+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeCaptchaImage"/>
60+
<actionGroup ref="AssertStorefrontCaptchaVisibleOnCustomerSignInPopupActionGroup" stepKey="seeCaptchaReloadButton"/>
5061

5162
<actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/>
52-
<comment userInput="Replacing reload action and preserve Backward Compatibility" stepKey="waitForPageLoad2" />
63+
<comment userInput="Replacing reload action and preserve Backward Compatibility" stepKey="waitForPageLoad2"/>
64+
65+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCart2"/>
66+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout2"/>
5367

54-
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickCart2"/>
55-
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout2"/>
5668
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.email}}" stepKey="waitEmailFieldVisible2"/>
57-
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaField}}" stepKey="seeCaptchaField2"/>
58-
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaImg}}" stepKey="seeCaptchaImage2"/>
59-
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaReload}}" stepKey="seeCaptchaReloadButton2"/>
69+
70+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeCaptchaField2"/>
71+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeCaptchaImage2"/>
72+
<actionGroup ref="AssertStorefrontCaptchaVisibleOnCustomerSignInPopupActionGroup" stepKey="seeCaptchaReloadButton2"/>
6073
</test>
6174
</tests>

0 commit comments

Comments
 (0)