|
| 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="StoreFrontVerifyMultishippingCheckoutForVirtualProductTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Verify Multishipping checkout flow if cart contains virtual product type"/> |
| 14 | + <title value="Verify Multishipping checkout flow if cart contains virtual product type"/> |
| 15 | + <description value="Verify Multishipping checkout flow if cart contains virtual product type"/> |
| 16 | + <testCaseId value="MC-26600"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + </annotations> |
| 19 | + |
| 20 | + <before> |
| 21 | + |
| 22 | + <!-- Create default category --> |
| 23 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 24 | + |
| 25 | + <!-- Create virtual product --> |
| 26 | + <createData entity="VirtualProduct" stepKey="createVirtualProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + |
| 30 | + <!-- Create simple product --> |
| 31 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 32 | + <requiredEntity createDataKey="createCategory"/> |
| 33 | + </createData> |
| 34 | + |
| 35 | + <!-- Assign virtual product to default category --> |
| 36 | + <createData entity="AssignProductToCategory" stepKey="assignCategoryToVirtualProduct"> |
| 37 | + <requiredEntity createDataKey="createCategory"/> |
| 38 | + <requiredEntity createDataKey="createVirtualProduct"/> |
| 39 | + </createData> |
| 40 | + |
| 41 | + <!-- Assign Simple product to default category --> |
| 42 | + <createData entity="AssignProductToCategory" stepKey="assignCategoryToSimpleProduct"> |
| 43 | + <requiredEntity createDataKey="createCategory"/> |
| 44 | + <requiredEntity createDataKey="createSimpleProduct"/> |
| 45 | + </createData> |
| 46 | + |
| 47 | + <!-- Create customer --> |
| 48 | + <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> |
| 49 | + </before> |
| 50 | + <after> |
| 51 | + <!-- delete category,product,customer --> |
| 52 | + <deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/> |
| 53 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 54 | + <deleteData createDataKey="createCategory" stepKey="deleteSimpleCategory"/> |
| 55 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 56 | + </after> |
| 57 | + |
| 58 | + <!-- Go to Storefront as Customer from preconditions --> |
| 59 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> |
| 60 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 61 | + </actionGroup> |
| 62 | + |
| 63 | + <!-- Customer added Virtual Product to Cart --> |
| 64 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addVirtualProductToCart"> |
| 65 | + <argument name="product" value="$$createVirtualProduct$$"/> |
| 66 | + </actionGroup> |
| 67 | + |
| 68 | + <!-- Customer added Simple Product to Cart --> |
| 69 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> |
| 70 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 71 | + </actionGroup> |
| 72 | + |
| 73 | + <!-- Go to Shopping Cart page --> |
| 74 | + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickOnViewEditCart"/> |
| 75 | + |
| 76 | + <!-- Check shopping cart contains both the Product--> |
| 77 | + <seeElement selector="{{StorefrontMinicartSection.productCartName($$createVirtualProduct.name$$)}}" stepKey="AssertVirtualProduct"/> |
| 78 | + <seeElement selector="{{StorefrontMinicartSection.productCartName($$createSimpleProduct.name$$)}}" stepKey="AssertSimpleProduct"/> |
| 79 | + |
| 80 | + <!-- Link "Check Out with Multiple Addresses" is shown --> |
| 81 | + <seeLink userInput="Check Out with Multiple Addresses" stepKey="seeLinkIsOpened"/> |
| 82 | + |
| 83 | + <!-- Click Check Out with Multiple Addresses --> |
| 84 | + <actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/> |
| 85 | + |
| 86 | + <!-- Check Ship to Multiple Address Page is opened--> |
| 87 | + <!-- <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}/multishipping/checkout/addresses" userInput="checkout/addresses"/> --> |
| 88 | + <wait time="10" stepKey="10"/> |
| 89 | + <seeInCurrentUrl url="{{MultishippingCheckoutAddressesPage.url}}" stepKey="seeShiptoMultipleAddressesPageIsOpened"/> |
| 90 | + |
| 91 | + <!-- Assert Simple product has address in Send To section--> |
| 92 | + <actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="verifyLine1Qty"> |
| 93 | + <argument name="productName" value="$createSimpleProduct.name$"/> |
| 94 | + </actionGroup> |
| 95 | + |
| 96 | + <!--Virtual product has a message in Send To section : "A shipping selection is not applicable.--> |
| 97 | + <grabTextFrom selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.shippingnotapplicable($$createVirtualProduct.name$$)}}" stepKey="grabshippingtext"/> |
| 98 | + <assertEquals message="Virtual product has a message in Send To section : 'A shipping selection is not applicable" stepKey="ssertEquals1"> |
| 99 | + <expectedResult type="string">A shipping selection is not applicable.</expectedResult> |
| 100 | + <actualResult type="string">$grabshippingtext</actualResult> |
| 101 | + </assertEquals> |
| 102 | + |
| 103 | + <!-- Click Go to Shipping Information* --> |
| 104 | + <click selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.goToShippingInformation}}" stepKey="clickGoToShippingInformation"/> |
| 105 | + |
| 106 | + |
| 107 | + <!-- See Shipping Method is opened --> |
| 108 | + <wait time="10" stepKey="20"/> |
| 109 | + <seeInCurrentUrl url="{{MultishippingCheckoutShippingPage.url}}" stepKey="seeSelectShippingMethodPageIsOpened"/> |
| 110 | + |
| 111 | + |
| 112 | + <!-- Halt test execution for 10 seconds before continuing. --> |
| 113 | + <wait time="10" stepKey="29"/> |
| 114 | + <!-- See Shipping Method available ONLY for Simple product--> |
| 115 | + <seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.shippingmethods($$createSimpleProduct.name$$)}}" stepKey="ShippingMethodForSimpleProduct"/> |
| 116 | + |
| 117 | + <!-- See For Virtual product : "Shipping is not applicable.--> |
| 118 | + <seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.otheritems($$createVirtualProduct.name$$)}}" stepKey="ShippingMethodForVirtalProduct"/> |
| 119 | + |
| 120 | + <!-- Click On Continue to Billing--> |
| 121 | + <click selector="{{StorefrontMultishippingCheckoutShippingToolbarSection.continueToBilling}}" stepKey="clickContinueToBilling"/> |
| 122 | + <waitForPageLoad stepKey="waitForCheckoutShippingToolbarPageLoad"/> |
| 123 | + |
| 124 | + <!-- See Billing Information Page is opened--> |
| 125 | + <wait time="10" stepKey="30"/> |
| 126 | + <seeInCurrentUrl url="{{MultishippingCheckoutBillingPage.url}}" stepKey="seeBillingPageIsOpened"/> |
| 127 | + |
| 128 | + <!-- Check Page contains customer's billing address--> |
| 129 | + <actionGroup ref="StorefrontAssertBillingAddressInBillingInfoStepActionGroup" stepKey="assertCustomerBillingInformation"/> |
| 130 | + |
| 131 | + |
| 132 | + <!-- Page contains Payment Method --> |
| 133 | + <seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.checkmoneyorder}}" stepKey="CheckMoney"/> |
| 134 | + |
| 135 | + <!-- Select Payment method "Check / Money Order --> |
| 136 | + <conditionalClick selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.checkmoneyorder}}" dependentSelector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.checkmoneyorder}}" visible="true" stepKey="selectCheckmoPaymentMethod"/> |
| 137 | + |
| 138 | + <!-- Select Payment method e.g. "Check / Money Order" and click Go to Review Your Order --> |
| 139 | + <wait time="10" stepKey="waitforReviewOrderButton"/> |
| 140 | + <click selector="{{StorefrontMultishippingCheckoutBillingToolbarSection.goToReviewOrder}}" stepKey="clickGoToReviewOrder"/> |
| 141 | + |
| 142 | + |
| 143 | + <!-- Check Page contains customer's billing address on OverViewPage--> |
| 144 | + <actionGroup ref="StorefrontAssertBillingAddressInBillingInfoStepActionGroup" stepKey="assertCustomerBillingInformationonOverViewPage"/> |
| 145 | + |
| 146 | + <!-- Check Payment Method on OverViewPage--> |
| 147 | + <seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.checkmoneyorderonOverViewPage}}" stepKey="CheckMoneyonOverViewPage"/> |
| 148 | + |
| 149 | + <!-- "Shipping To" - address that customer selected for shipping --> |
| 150 | + <actionGroup ref="StoreFrontAssertCustomerShippingAddressOrderViewPageActionGroup" stepKey="assertCustomerShippinginformation"/> |
| 151 | + |
| 152 | + <!--other shipping methods contain Virtual Product--> |
| 153 | + <seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.othershippingitems($$createVirtualProduct.name$$)}}" stepKey="otherItemsContainsVirtualProduct" /> |
| 154 | + |
| 155 | + <!--Click on Place Order"--> |
| 156 | + <click selector="{{StorefrontMultishippingCheckoutOverviewReviewSection.placeOrder}}" stepKey="tryToPlaceOrder1"/> |
| 157 | + |
| 158 | + <!--Check Thank you for your purchase!" page is opened --> |
| 159 | + <see selector="{{StorefrontMultipleShippingMethodSection.successMessage}}" userInput="Successfully ordered" stepKey="seeSuccessMessage"/> |
| 160 | + |
| 161 | + <!--Grab Order ID of Simple and Virtual Product --> |
| 162 | + <grabTextFrom selector="{{StorefrontMultipleShippingMethodSection.orderId('1')}}" stepKey="grabFirstOrderId"/> |
| 163 | + <grabTextFrom selector="{{StorefrontMultipleShippingMethodSection.orderId('2')}}" stepKey="grabSecondOrderId"/> |
| 164 | + |
| 165 | + <!--Open Simple Product Link --> |
| 166 | + <click selector="{{StorefrontMultipleShippingMethodSection.orderByPosition('1')}}" stepKey="openOrderDetailsPage"/> |
| 167 | + |
| 168 | + <!--Assert Shipping Information for Simple Product --> |
| 169 | + <seeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.shippingaddresstext}}" stepKey="assertSimpleProductShippingOrderDetails"/> |
| 170 | + |
| 171 | + <!-- Move back one page in history. --> |
| 172 | + <moveBack stepKey="moveBack"/> |
| 173 | + |
| 174 | + <!--Open Virtual Product Link --> |
| 175 | + <click selector="{{StorefrontMultipleShippingMethodSection.orderByPosition('2')}}" stepKey="assertVirtualProductShippingOrderDetails"/> |
| 176 | + |
| 177 | + <!--Open Virtual Product Link --> |
| 178 | + <dontSeeElement selector="{{StorefrontMultishippingCheckoutAddressesToolbarSection.shippingaddresstext}}" stepKey="assertVirtualsseehipping"/> |
| 179 | + |
| 180 | + </test> |
| 181 | +</tests> |
| 182 | + |
0 commit comments