|
| 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="StorefrontAssertTermInCheckout"> |
| 12 | + <arguments> |
| 13 | + <argument name="termCheckboxText" type="string"/> |
| 14 | + <argument name="product" defaultValue="SimpleTwo"/> |
| 15 | + </arguments> |
| 16 | + |
| 17 | + <!--Add product to cart--> |
| 18 | + <amOnPage url="{{StorefrontProductPage.url(product.custom_attributes[url_key])}}" stepKey="goToProductPage"/> |
| 19 | + <waitForPageLoad stepKey="waitForProductPage"/> |
| 20 | + <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart"/> |
| 21 | + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/> |
| 22 | + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/> |
| 23 | + <waitForElementVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAddToCart}}" stepKey="waitForElementVisibleAddToCartButtonTitleIsAddToCart"/> |
| 24 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 25 | + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProductAddedMessage"/> |
| 26 | + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> |
| 27 | + |
| 28 | + <!--Go to Checkout--> |
| 29 | + <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> |
| 30 | + <wait time="5" stepKey="waitMinicartRendering"/> |
| 31 | + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> |
| 32 | + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> |
| 33 | + |
| 34 | + <!--Process steps--> |
| 35 | + <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/> |
| 36 | + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/> |
| 37 | + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/> |
| 38 | + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="enterStreet"/> |
| 39 | + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{CustomerAddressSimple.city}}" stepKey="enterCity"/> |
| 40 | + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{CustomerAddressSimple.state}}" stepKey="selectRegion"/> |
| 41 | + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="enterPostcode"/> |
| 42 | + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="enterTelephone"/> |
| 43 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask1"/> |
| 44 | + <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('')}}" stepKey="selectShippingMethod"/> |
| 45 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> |
| 46 | + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> |
| 47 | + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> |
| 48 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> |
| 49 | + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> |
| 50 | + |
| 51 | + <!--Check if agreement is present on checkout and select it--> |
| 52 | + <see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{termCheckboxText}}" stepKey="seeTermInCheckout"/> |
| 53 | + <selectOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" userInput="{{termCheckboxText}}" stepKey="checkAgreement"/> |
| 54 | + |
| 55 | + <!--Checkout select Check/Money Order payment--> |
| 56 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/> |
| 57 | + <waitForPageLoad stepKey="waitForPageLoad2"/> |
| 58 | + <conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/> |
| 59 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> |
| 60 | + |
| 61 | + <!--Click Place Order button--> |
| 62 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> |
| 63 | + |
| 64 | + <!--See success messages--> |
| 65 | + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> |
| 66 | + <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/> |
| 67 | + </actionGroup> |
| 68 | +</actionGroups> |
0 commit comments