-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAGETWO-91552: [github] CAPTCHA doesn't show when check out as guest
- Add automated test
- Loading branch information
Showing
4 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
app/code/Magento/Captcha/Test/Mftf/ActionGroup/CaptchaFormsDisplayingActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="CaptchaFormsDisplayingActionGroup"> | ||
<click selector="{{CaptchaFormsDisplayingSection.store}}" stepKey="ClickToGoStores"/> | ||
<waitForPageLoad stepKey="waitForStoresLoaded"/> | ||
<click selector="{{CaptchaFormsDisplayingSection.config}}" stepKey="ClickToGoConfiguration"/> | ||
<waitForPageLoad stepKey="waitForConfigurationsLoaded"/> | ||
<scrollTo selector="{{CaptchaFormsDisplayingSection.customer}}" stepKey="ScrollToCustomers"/> | ||
<click selector="{{CaptchaFormsDisplayingSection.customer}}" stepKey="ClickToCustomers"/> | ||
<waitForPageLoad stepKey="waitForCustomerConfigurationsLoaded"/> | ||
<click selector="{{CaptchaFormsDisplayingSection.customerConfig}}" stepKey="ClickToGoCustomerConfiguration"/> | ||
<scrollTo selector="{{CaptchaFormsDisplayingSection.captcha}}" stepKey="scrollToCaptcha"/> | ||
<conditionalClick selector="{{CaptchaFormsDisplayingSection.captcha}}" dependentSelector="{{CaptchaFormsDisplayingSection.dependent}}" visible="false" stepKey="ClickToOpenCaptcha"/> | ||
</actionGroup> | ||
</actionGroups> |
20 changes: 20 additions & 0 deletions
20
app/code/Magento/Captcha/Test/Mftf/Data/CaptchaFormsDisplayingData.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd"> | ||
<entity name="CaptchaData"> | ||
<data key="createUser">Create user</data> | ||
<data key="login">Login</data> | ||
<data key="passwd">Forgot password</data> | ||
<data key="contactUs">Contact Us</data> | ||
<data key="changePasswd">Change password</data> | ||
<data key="register">Register during Checkout</data> | ||
<data key="checkoutAsGuest">Check Out as Guest</data> | ||
</entity> | ||
</entities> |
27 changes: 27 additions & 0 deletions
27
app/code/Magento/Captcha/Test/Mftf/Section/CaptchaFormsDisplayingSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> | ||
<section name="CaptchaFormsDisplayingSection"> | ||
<element name="store" type="button" selector="#menu-magento-backend-stores"/> | ||
<element name="config" type="button" selector="//li[@data-ui-id='menu-magento-config-system-config']//span"/> | ||
<element name="customer" type="button" selector="//div[@class='admin__page-nav-title title _collapsible']//strong[text()='Customers']"/> | ||
<element name="customerConfig" type="text" selector="//span[text()='Customer Configuration']"/> | ||
<element name="captcha" type="button" selector="#customer_captcha-head"/> | ||
<element name="dependent" type="button" selector="//a[@id='customer_captcha-head' and @class='open']"/> | ||
<element name="forms" type="multiselect" selector="#customer_captcha_forms"/> | ||
<element name="createUser" type="multiselect" selector="//select[@id='customer_captcha_forms']/option[@value='user_create']"/> | ||
<element name="forgotpassword" type="multiselect" selector="//select[@id='customer_captcha_forms']/option[@value='user_forgotpassword']"/> | ||
<element name="userLogin" type="multiselect" selector="//select[@id='customer_captcha_forms']/option[@value='user_login']"/> | ||
<element name="guestCheckout" type="multiselect" selector="//select[@id='customer_captcha_forms']/option[@value='guest_checkout']"/> | ||
<element name="register" type="multiselect" selector="//select[@id='customer_captcha_forms']/option[@value='register_during_checkout']"/> | ||
<element name="userEdit" type="multiselect" selector="//select[@id='customer_captcha_forms']/option[@value='user_edit']"/> | ||
<element name="contactUs" type="multiselect" selector="//select[@id='customer_captcha_forms']/option[@value='contact_us']"/> | ||
</section> | ||
</sections> |
69 changes: 69 additions & 0 deletions
69
app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> | ||
<test name="CaptchaFormsDisplayingTest"> | ||
<annotations> | ||
<features value="Captcha"/> | ||
<stories value="MAGETWO-91552 - [github] CAPTCHA doesn't show when check out as guest"/> | ||
<title value="Captcha forms displaying"/> | ||
<description value="Captcha forms displaying"/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MAGETWO-93941"/> | ||
<group value="captcha"/> | ||
</annotations> | ||
|
||
<!--Login as admin--> | ||
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> | ||
<!--Go to Captcha--> | ||
<actionGroup ref="CaptchaFormsDisplayingActionGroup" stepKey="CaptchaFormsDisplayingActionGroup"/> | ||
<waitForPageLoad stepKey="WaitForPageLoaded"/> | ||
<!--Verify fields removed--> | ||
<grabTextFrom selector="{{CaptchaFormsDisplayingSection.forms}}" stepKey="formItems"/> | ||
<assertNotContains stepKey="checkoutAsGuest"> | ||
<expectedResult type="string">{{CaptchaData.checkoutAsGuest}}</expectedResult> | ||
<actualResult type="variable">$formItems</actualResult> | ||
</assertNotContains> | ||
<assertNotContains stepKey="register"> | ||
<expectedResult type="string">{{CaptchaData.register}}</expectedResult> | ||
<actualResult type="variable">$formItems</actualResult> | ||
</assertNotContains> | ||
<!--Verify fields existence--> | ||
<grabTextFrom selector="{{CaptchaFormsDisplayingSection.createUser}}" stepKey="createUser"/> | ||
<assertEquals stepKey="CreateUserFieldIsPresent"> | ||
<expectedResult type="string">{{CaptchaData.createUser}}</expectedResult> | ||
<actualResult type="variable">$createUser</actualResult> | ||
</assertEquals> | ||
<grabTextFrom selector="{{CaptchaFormsDisplayingSection.userLogin}}" stepKey="login"/> | ||
<assertEquals stepKey="LoginFieldIsPresent"> | ||
<expectedResult type="string">{{CaptchaData.login}}</expectedResult> | ||
<actualResult type="variable">login</actualResult> | ||
</assertEquals> | ||
<grabTextFrom selector="{{CaptchaFormsDisplayingSection.forgotpassword}}" stepKey="forgotpassword"/> | ||
<assertEquals stepKey="PasswordFieldIsPresent"> | ||
<expectedResult type="string">{{CaptchaData.passwd}}</expectedResult> | ||
<actualResult type="variable">$forgotpassword</actualResult> | ||
</assertEquals> | ||
<grabTextFrom selector="{{CaptchaFormsDisplayingSection.contactUs}}" stepKey="contactUs"/> | ||
<assertEquals stepKey="contactUsFieldIsPresent"> | ||
<expectedResult type="string">{{CaptchaData.contactUs}}</expectedResult> | ||
<actualResult type="variable">$contactUs</actualResult> | ||
</assertEquals> | ||
<grabTextFrom selector="{{CaptchaFormsDisplayingSection.userEdit}}" stepKey="userEdit"/> | ||
<assertEquals stepKey="userEditFieldIsPresent"> | ||
<expectedResult type="string">{{CaptchaData.changePasswd}}</expectedResult> | ||
<actualResult type="variable">$userEdit</actualResult> | ||
</assertEquals> | ||
|
||
<!--Roll back configuration--> | ||
<scrollToTopOfPage stepKey="ScrollToTop"/> | ||
<click selector="{{CaptchaFormsDisplayingSection.captcha}}" stepKey="ClickToCloseCaptcha"/> | ||
|
||
</test> | ||
</tests> |