|
| 1 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 2 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 3 | + <test name="CustomerOrderSimpleProduct"> |
| 4 | + <annotations> |
| 5 | + <features value="Checkout"/> |
| 6 | + <stories value="Customer Order Simple Product"/> |
| 7 | + <title value="Customer Order Simple Product"/> |
| 8 | + <description value="Customer Order Simple Product"/> |
| 9 | + <stories value="Customer Checkout"/> |
| 10 | + <severity value="MAJOR"/> |
| 11 | + <group value="checkout"/> |
| 12 | + <group value="shoppingCart"/> |
| 13 | + </annotations> |
| 14 | + <before> |
| 15 | + <!-- create category --> |
| 16 | + <createData entity="_defaultCategory" stepKey="testCategory"/> |
| 17 | + <!-- create data --> |
| 18 | + <createData entity="_defaultProduct" stepKey="testProduct"> |
| 19 | + <requiredEntity createDataKey="testCategory"/> |
| 20 | + </createData> |
| 21 | + <!-- Assign Product to Category --> |
| 22 | + <createData entity="AssignProductToCategory" stepKey="assignTestCategoryToTestProduct"> |
| 23 | + <requiredEntity createDataKey="testCategory"/> |
| 24 | + <requiredEntity createDataKey="testProduct"/> |
| 25 | + </createData> |
| 26 | + <!-- create customer --> |
| 27 | + <createData entity="CustomerEntityOne" stepKey="createCustomer"/> |
| 28 | + </before> |
| 29 | + |
| 30 | + <after> |
| 31 | + <!-- delete category,product,customer --> |
| 32 | + <deleteData createDataKey="testProduct" stepKey="deleteSimpleProduct"/> |
| 33 | + <deleteData createDataKey="testCategory" stepKey="deleteSimpleCategory"/> |
| 34 | + <deleteData createDataKey="createCustomer" stepKey="deleteGloCustomer"/> |
| 35 | + </after> |
| 36 | + <!-- Login as customer --> |
| 37 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> |
| 38 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 39 | + </actionGroup> |
| 40 | + <!-- Go to category --> |
| 41 | + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage"> |
| 42 | + <argument name="category" value="$$testCategory$$"/> |
| 43 | + </actionGroup> |
| 44 | + <waitForPageLoad stepKey="waitForCatalogPageLoad"/> |
| 45 | + |
| 46 | + |
| 47 | + <!-- Open product detail page--> |
| 48 | + <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($testProduct.name$)}}" stepKey="openProduct"/> |
| 49 | + <waitForPageLoad time="30" stepKey="waitForFirstProduct"/> |
| 50 | + |
| 51 | + <!-- add to cart --> |
| 52 | + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> |
| 53 | + <argument name="productName" value="$$testProduct.name$$"/> |
| 54 | + </actionGroup> |
| 55 | + |
| 56 | + <!-- click on cart icon and proceed to checkout --> |
| 57 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> |
| 58 | + |
| 59 | + |
| 60 | + <!-- Steps to perform checkout --> |
| 61 | + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> |
| 62 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> |
| 63 | + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> |
| 64 | + |
| 65 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" after="clickNext" stepKey="waitForPaymentSectionLoaded2"/> |
| 66 | + <conditionalClick selector="{{CheckoutPaymentSection.checkMoneyOrderPayment}}" dependentSelector="{{CheckoutPaymentSection.billingAddress}}" visible="false" before="waitForPlaceOrderButton" stepKey="clickCheckMoneyOrderPayment"/> |
| 67 | + |
| 68 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> |
| 69 | + <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> |
| 70 | + |
| 71 | + <!-- order number is captured for future validation --> |
| 72 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="getOrderNumber"/> |
| 73 | + </test> |
| 74 | +</tests> |
0 commit comments