|
| 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="StorefrontCaptchaOnOnepageCheckoutPyamentTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Captcha"/> |
| 14 | + <stories value="Place order on checkout page + Captcha"/> |
| 15 | + <title value="Captcha on checkout page test"/> |
| 16 | + <description value="Test creation of order on storefront checkout page with captcha."/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="MC-41461"/> |
| 19 | + <useCaseId value="MC-41281"/> |
| 20 | + <group value="captcha"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Create Simple Product --> |
| 24 | + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> |
| 25 | + <field key="price">20</field> |
| 26 | + </createData> |
| 27 | + |
| 28 | + <!-- Create customer --> |
| 29 | + <createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/> |
| 30 | + |
| 31 | + <!-- Enable payment method --> |
| 32 | + <magentoCLI command="config:set {{BankTransferEnableConfigData.path}} {{BankTransferEnableConfigData.value}}" stepKey="enableBankTransfer"/> |
| 33 | + |
| 34 | + <!-- Enable captcha for Checkout/Placing Order --> |
| 35 | + <magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}}" stepKey="enableOnOpageCheckoutCaptcha" /> |
| 36 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAlwaysConfigData.path}} {{StorefrontCustomerCaptchaModeAlwaysConfigData.value}}" stepKey="alwaysEnableCaptcha" /> |
| 37 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaLength3ConfigData.path}} {{StorefrontCustomerCaptchaLength3ConfigData.value}}" stepKey="setCaptchaLength" /> |
| 38 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaSymbols1ConfigData.path}} {{StorefrontCustomerCaptchaSymbols1ConfigData.value}}" stepKey="setCaptchaSymbols" /> |
| 39 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 40 | + <argument name="tags" value="config full_page"/> |
| 41 | + </actionGroup> |
| 42 | + </before> |
| 43 | + <after> |
| 44 | + <!-- Disabled payment method --> |
| 45 | + <magentoCLI command="config:set {{BankTransferDisabledConfigData.path}} {{BankTransferDisabledConfigData.value}}" stepKey="disabledBankTransfer"/> |
| 46 | + |
| 47 | + <!-- Set default configuration for captcha --> |
| 48 | + <magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}},{{StorefrontCaptchaOnCustomerForgotPasswordConfigData.value}}" stepKey="enableCaptchaOnDefaultForms" /> |
| 49 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAfterFailConfigData.path}} {{StorefrontCustomerCaptchaModeAfterFailConfigData.value}}" stepKey="defaultCaptchaMode" /> |
| 50 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultLengthConfigData.path}} {{StorefrontCustomerCaptchaDefaultLengthConfigData.value}}" stepKey="setDefaultCaptchaLength" /> |
| 51 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.path}} {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.value}}" stepKey="setDefaultCaptchaSymbols" /> |
| 52 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 53 | + <argument name="tags" value="config full_page"/> |
| 54 | + </actionGroup> |
| 55 | + |
| 56 | + <!-- Customer logout --> |
| 57 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> |
| 58 | + |
| 59 | + <!-- Delete created products --> |
| 60 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 61 | + |
| 62 | + <!-- Delete customer --> |
| 63 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 64 | + </after> |
| 65 | + |
| 66 | + <!-- Reindex and flush cache --> |
| 67 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 68 | + <argument name="indices" value=""/> |
| 69 | + </actionGroup> |
| 70 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> |
| 71 | + <argument name="tags" value=""/> |
| 72 | + </actionGroup> |
| 73 | + |
| 74 | + <!-- Add Simple Product to cart --> |
| 75 | + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> |
| 76 | + <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> |
| 77 | + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartSimpleProductFromStorefrontProductPage"> |
| 78 | + <argument name="productName" value="$$createSimpleProduct.name$$"/> |
| 79 | + </actionGroup> |
| 80 | + |
| 81 | + <!-- Go to shopping cart --> |
| 82 | + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> |
| 83 | + <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> |
| 84 | + <argument name="address" value="US_Address_CA"/> |
| 85 | + </actionGroup> |
| 86 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/> |
| 87 | + |
| 88 | + <!-- Login as customer on checkout page --> |
| 89 | + <actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="customerLogin"> |
| 90 | + <argument name="customer" value="$$createCustomer$$"/> |
| 91 | + </actionGroup> |
| 92 | + |
| 93 | + <!-- Fill customer new shipping address --> |
| 94 | + <actionGroup ref="CustomerCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress"> |
| 95 | + <argument name="address" value="US_Address_TX"/> |
| 96 | + </actionGroup> |
| 97 | + |
| 98 | + <!-- Click next button to open payment section --> |
| 99 | + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> |
| 100 | + |
| 101 | + <!-- Select payment method --> |
| 102 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> |
| 103 | + <click selector="{{StorefrontCheckoutPaymentMethodsSection.bankTransfer}}" stepKey="selectBankTransferMethod"/> |
| 104 | + |
| 105 | + <!-- Enter captcha value --> |
| 106 | + <fillField userInput="{{PreconfiguredCaptcha.value}}" selector="{{StorefrontCaptchaOnOnepageCheckoutPyamentSection.captchaField}}" stepKey="fillCaptchaField" /> |
| 107 | + |
| 108 | + <!-- Place Order --> |
| 109 | + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="customerPlaceOrder"> |
| 110 | + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> |
| 111 | + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> |
| 112 | + </actionGroup> |
| 113 | + |
| 114 | + <!-- Assert order grand total --> |
| 115 | + <amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="navigateToCustomerDashboardPage"/> |
| 116 | + <waitForPageLoad stepKey="waitForCustomerDashboardPageLoad"/> |
| 117 | + <see selector="{{StorefrontCustomerRecentOrdersSection.orderTotal}}" userInput="$25.00" stepKey="checkOrderTotalInStorefront"/> |
| 118 | + </test> |
| 119 | +</tests> |
0 commit comments