|
| 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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="MultiShippingWithCreationNewCustomerAndAddressesDuringCheckoutTest"> |
| 11 | + <annotations> |
| 12 | + <stories value="Multi shipping with creation new customer and addresses during checkout"/> |
| 13 | + <title value="Verify Multi shipping with creation new customer and addresses during checkout"/> |
| 14 | + <description value="Verify Multi shipping with creation new customer and addresses during checkout"/> |
| 15 | + <severity value="MAJOR"/> |
| 16 | + <testCaseId value="AC-4685" /> |
| 17 | + </annotations> |
| 18 | + <before> |
| 19 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/> |
| 20 | + <!-- remove the Filter From the page--> |
| 21 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> |
| 22 | + <actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clearFilterFromProductIndex"/> |
| 23 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 24 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 25 | + <requiredEntity createDataKey="createCategory"/> |
| 26 | + <field key="name">simple product</field> |
| 27 | + </createData> |
| 28 | + <!-- Create configurable product --> |
| 29 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> |
| 30 | + <requiredEntity createDataKey="createCategory"/> |
| 31 | + <field key="name">config product</field> |
| 32 | + </createData> |
| 33 | + <!-- Search for the Created Configurable Product --> |
| 34 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openConfigurableProductEditPage"> |
| 35 | + <argument name="productId" value="$createConfigProduct.id$"/> |
| 36 | + </actionGroup> |
| 37 | + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> |
| 38 | + <waitForPageLoad stepKey="waitForSelectAttributesPage"/> |
| 39 | + <actionGroup ref="CreateOptionsForAttributeActionGroup" stepKey="createOptions"> |
| 40 | + <argument name="attributeName" value="Color"/> |
| 41 | + <argument name="firstOptionName" value="Red"/> |
| 42 | + <argument name="secondOptionName" value="Green"/> |
| 43 | + </actionGroup> |
| 44 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> |
| 45 | + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="clickOnApplySinglePriceToAllSkus"/> |
| 46 | + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="10" stepKey="enterAttributePrice"/> |
| 47 | + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> |
| 48 | + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterAttributeQuantity"/> |
| 49 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextStep"/> |
| 50 | + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextPageOpened"/> |
| 51 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProducts"/> |
| 52 | + <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveButtonVisible"/> |
| 53 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> |
| 54 | + <conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="clickOnConfirmInPopup"/> |
| 55 | + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> |
| 56 | + </before> |
| 57 | + <after> |
| 58 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> |
| 59 | + <actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clearGridFilters"/> |
| 60 | + <actionGroup ref="AdminDeleteAllProductsFromGridActionGroup" stepKey="deleteAllProducts"/> |
| 61 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 62 | + <!-- Delete customer --> |
| 63 | + <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteCustomer"> |
| 64 | + <argument name="email" value="{{CustomerEntityOne.email}}"/> |
| 65 | + </actionGroup> |
| 66 | + <actionGroup ref="AdminDeleteCreatedColorAttributeActionGroup" stepKey="deleteRedColorAttribute"> |
| 67 | + <argument name="Color" value="Red"/> |
| 68 | + </actionGroup> |
| 69 | + <actionGroup ref="AdminDeleteCreatedColorAttributeActionGroup" stepKey="deleteBlueColorAttribute"> |
| 70 | + <argument name="Color" value="Green"/> |
| 71 | + </actionGroup> |
| 72 | + <!-- reindex and flush cache --> |
| 73 | + <magentoCron groups="index" stepKey="reindex"/> |
| 74 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache"> |
| 75 | + <argument name="tags" value="full_page"/> |
| 76 | + </actionGroup> |
| 77 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> |
| 78 | + </after> |
| 79 | + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="openCategoryPage"> |
| 80 | + <argument name="categoryUrl" value="$$createCategory.custom_attributes[url_key]$$"/> |
| 81 | + </actionGroup> |
| 82 | + <waitForPageLoad stepKey="waitForProductPage"/> |
| 83 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> |
| 84 | + <argument name="product" value="$createSimpleProduct$"/> |
| 85 | + </actionGroup> |
| 86 | + <!-- Add configurable product to the cart --> |
| 87 | + <actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart1"> |
| 88 | + <argument name="urlKey" value="$$createConfigProduct.custom_attributes[url_key]$$" /> |
| 89 | + <argument name="productAttribute" value="Color"/> |
| 90 | + <argument name="productOption" value="Red"/> |
| 91 | + <argument name="qty" value="1"/> |
| 92 | + </actionGroup> |
| 93 | + <actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart2"> |
| 94 | + <argument name="urlKey" value="$$createConfigProduct.custom_attributes[url_key]$$" /> |
| 95 | + <argument name="productAttribute" value="Color"/> |
| 96 | + <argument name="productOption" value="Green"/> |
| 97 | + <argument name="qty" value="1"/> |
| 98 | + </actionGroup> |
| 99 | + <!-- Check Out with Multiple Addresses --> |
| 100 | + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> |
| 101 | + <waitForElementVisible selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="waitMultipleAddressShippingButton"/> |
| 102 | + <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> |
| 103 | + <!--Create an account--> |
| 104 | + <waitForElementVisible selector="{{AdminCreateUserSection.createAnAccountButtonForCustomer}}" stepKey="waitCreateAnAccountButton"/> |
| 105 | + <click selector="{{AdminCreateUserSection.createAnAccountButtonForCustomer}}" stepKey="clickOnCreateAnAccountButton"/> |
| 106 | + <waitForPageLoad stepKey="waitForCreateAccountPageToLoad"/> |
| 107 | + <actionGroup ref="EnterAddressDetailsActionGroup" stepKey="enterAddressInfo"> |
| 108 | + <argument name="Address" value="US_Address_CA"/> |
| 109 | + </actionGroup> |
| 110 | + <actionGroup ref="StorefrontFillCustomerCreateAnAccountActionGroup" stepKey="fillDetails"> |
| 111 | + <argument name="customer" value="CustomerEntityOne"/> |
| 112 | + </actionGroup> |
| 113 | + <actionGroup ref="StorefrontClickCreateAnAccountCustomerAccountCreationFormActionGroup" stepKey="submitCreateAccountForm"/> |
| 114 | + <click selector="{{MultishippingSection.enterNewAddress}}" stepKey="clickOnAddress"/> |
| 115 | + <waitForPageLoad stepKey="waitForAddressFieldsPageOpen"/> |
| 116 | + <actionGroup ref="FillNewCustomerAddressFieldsActionGroup" stepKey="editAddressFields"> |
| 117 | + <argument name="address" value="DE_Address_Berlin_Not_Default_Address"/> |
| 118 | + <argument name="address" value="DE_Address_Berlin_Not_Default_Address"/> |
| 119 | + </actionGroup> |
| 120 | + <actionGroup ref="StorefrontSaveCustomerAddressActionGroup" stepKey="saveAddress"/> |
| 121 | + <waitForPageLoad stepKey="waitForShippingPageToOpen"/> |
| 122 | + <actionGroup ref="StorefrontSelectAddressActionGroup" stepKey="selectCAAddress"> |
| 123 | + <argument name="sequenceNumber" value="1"/> |
| 124 | + <argument name="option" value="John Doe, 7700 West Parmer Lane 113, Los Angeles, California 90001, United States"/> |
| 125 | + </actionGroup> |
| 126 | + <actionGroup ref="StorefrontSelectAddressActionGroup" stepKey="selectCAAddressForSecondProduct"> |
| 127 | + <argument name="sequenceNumber" value="2"/> |
| 128 | + <argument name="option" value="John Doe, 7700 West Parmer Lane 113, Los Angeles, California 90001, United States"/> |
| 129 | + </actionGroup> |
| 130 | + <actionGroup ref="StorefrontSelectAddressActionGroup" stepKey="selectGEAddress"> |
| 131 | + <argument name="sequenceNumber" value="3"/> |
| 132 | + <argument name="option" value="John Doe, Augsburger Strabe 41, Berlin, Berlin 10789, Germany"/> |
| 133 | + </actionGroup> |
| 134 | + <actionGroup ref="StorefrontChangeMultishippingItemQtyActionGroup" stepKey="setProductQuantity"> |
| 135 | + <argument name="sequenceNumber" value="3"/> |
| 136 | + <argument name="quantity" value="10"/> |
| 137 | + </actionGroup> |
| 138 | + <actionGroup ref="StorefrontSaveAddressActionGroup" stepKey="saveAddresses"/> |
| 139 | + <waitForPageLoad stepKey="waitForPageToLoadProperly"/> |
| 140 | + <seeElement selector="{{ShippingMethodSection.productDetails('simple product','1')}}" stepKey="assertSimpleProductDetails"/> |
| 141 | + <seeElement selector="{{ShippingMethodSection.productDetails('config product','1')}}" stepKey="assertConfigProductRedDetails"/> |
| 142 | + <seeElement selector="{{ShippingMethodSection.productDetails('config product','10')}}" stepKey="assertConfigProductGreenDetails"/> |
| 143 | + <!-- Click 'Continue to Billing Information' --> |
| 144 | + <actionGroup ref="StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup" stepKey="useDefaultShippingMethod"/> |
| 145 | + <!-- Click 'Go to Review Your Order' --> |
| 146 | + <actionGroup ref="SelectBillingInfoActionGroup" stepKey="useDefaultBillingMethod"/> |
| 147 | + <!-- Click 'Place Order' --> |
| 148 | + <actionGroup ref="PlaceOrderActionGroup" stepKey="placeOrder"/> |
| 149 | + <waitForPageLoad stepKey="waitForOrderPlace"/> |
| 150 | + <grabTextFrom selector="{{StorefrontMultipleShippingMethodSection.orderId('1')}}" stepKey="grabFirstOrderId"/> |
| 151 | + <grabTextFrom selector="{{StorefrontMultipleShippingMethodSection.orderId('2')}}" stepKey="grabSecondOrderId"/> |
| 152 | + <!-- Go to My Account > My Orders and verify orderId--> |
| 153 | + <amOnPage url="{{StorefrontCustomerOrdersHistoryPage.url}}" stepKey="goToMyOrdersPage"/> |
| 154 | + <waitForPageLoad stepKey="waitForMyOrdersPageLoad"/> |
| 155 | + <seeElement selector="{{StorefrontCustomerOrdersGridSection.orderView({$grabFirstOrderId})}}" stepKey="seeFirstOrder"/> |
| 156 | + <seeElement selector="{{StorefrontCustomerOrdersGridSection.orderView({$grabSecondOrderId})}}" stepKey="seeSecondOrder"/> |
| 157 | + <!-- Logout customer --> |
| 158 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> |
| 159 | + </test> |
| 160 | +</tests> |
0 commit comments