|
| 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="LoggedInCustomerPlaceOrderWithPickupInStoreMethodWithGoogleAPIEnabledTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Simple Product Custom Stock."/> |
| 14 | + <title value="Logged in customer place order with Pickup In store method with Google API enabled."/> |
| 15 | + <description value="Logged in customer place order with Pickup In store method with Google API enabled."/> |
| 16 | + <testCaseId value="ACQE-4014"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + </annotations> |
| 19 | + |
| 20 | + <before> |
| 21 | + |
| 22 | + <!--Enable Store pickup--> |
| 23 | + <magentoCLI command="config:set {{EnableInStorePickup.path}} {{EnableInStorePickup.value}}" stepKey="enableInStorePickupMethod"/> |
| 24 | + |
| 25 | + <!--Enable Distance Provider for Distance Based SSA to online--> |
| 26 | + <magentoCLI command="config:set {{OnlineDistanceProviderForDistanceBasedSSA.path}} {{OnlineDistanceProviderForDistanceBasedSSA.value}}" stepKey="setDistanceProviderToOnline"/> |
| 27 | + |
| 28 | + <!--Clean chache and reindex--> |
| 29 | + <magentoCLI command="indexer:reindex" stepKey="performReindex"/> |
| 30 | + <magentoCLI command="cache:flush" stepKey="cleanCache"/> |
| 31 | + |
| 32 | + <createData entity="CulverStorePickupEnabledSource2" stepKey="createSource1"/> |
| 33 | + <createData entity="AustinStorePickupEnabledSource" stepKey="createSource2"/> |
| 34 | + <createData entity="BasicMsiStockWithMainWebsite1" stepKey="createStock"/> |
| 35 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"/> |
| 36 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 37 | + <createData entity="_defaultCategory" stepKey="category"/> |
| 38 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 39 | + </before> |
| 40 | + <after> |
| 41 | + <actionGroup ref="AssignWebsiteToStockActionGroup" stepKey="assignMainWebsiteToDefaultStock"> |
| 42 | + <argument name="stockName" value="{{_defaultStock.name}}"/> |
| 43 | + <argument name="websiteName" value="{{_defaultWebsite.name}}"/> |
| 44 | + </actionGroup> |
| 45 | + <!--Set Distance Provider for Distance Based SSA to offline--> |
| 46 | + <magentoCLI command="config:set {{OfflineDistanceProviderForDistanceBasedSSA.path}} {{OfflineDistanceProviderForDistanceBasedSSA.value}}" stepKey="setDistanceProviderToOffline"/> |
| 47 | + <!--Disable 'In Store Pickup' shipping method.--> |
| 48 | + <magentoCLI command="config:set {{DisableInStorePickup.path}} {{DisableInStorePickup.value}}" stepKey="enableInStorePickupMethod"/> |
| 49 | + |
| 50 | + <deleteData createDataKey="createStock" stepKey="deleteStock"/> |
| 51 | + |
| 52 | + <actionGroup ref="DisableAllSourcesActionGroup" stepKey="disableAllSources"/> |
| 53 | + |
| 54 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 55 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 56 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 57 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> |
| 58 | + </after> |
| 59 | + |
| 60 | + <amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/> |
| 61 | + <waitForPageLoad stepKey="waitForConfigPageToLoad"/> |
| 62 | + <conditionalClick stepKey="expandGoogledistanceProvider" selector="{{InventoryConfigSection.GoogleDistanceProvidedTab}}" dependentSelector="{{InventoryConfigSection.GoogleDistanceProvidedTabExpanded}}" visible="true"/> |
| 63 | + <fillField selector="{{InventoryConfigSection.GoogleDistanceProvided}}" userInput="AIzaSyD7QOaF7rcGVZQwrbG7AYNnFLwyuhGpQBU" stepKey="fillGoogleDistanceProvider"/> |
| 64 | + <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> |
| 65 | + <!--Clean chache and reindex--> |
| 66 | + <magentoCLI command="indexer:reindex" stepKey="performReindex"/> |
| 67 | + <magentoCLI command="cache:flush" stepKey="cleanCache"/> |
| 68 | + |
| 69 | + <actionGroup ref="AdminGoToStockGridFilterResultsByInputEditStock" |
| 70 | + stepKey="goToStockGridFilterResultsByInputEditStock1"> |
| 71 | + <argument name="filter_selector" value="AdminManageStockGridFilterControls.name"/> |
| 72 | + <argument name="filter_value" value="$$createStock.stock[name]$$"/> |
| 73 | + </actionGroup> |
| 74 | + |
| 75 | + <!--Assign Sources to stock--> |
| 76 | + <actionGroup ref="AdminOnStockEditPageAssignSourceToStock" stepKey="onStockEditPageAssignSourceToStock1"> |
| 77 | + <argument name="filter_selector" value="AdminManageStockGridFilterControls.name"/> |
| 78 | + <argument name="filter_value" value="$$createSource1.source[name]$$"/> |
| 79 | + </actionGroup> |
| 80 | + |
| 81 | + <actionGroup ref="AdminOnStockEditPageAssignSourceToStock" stepKey="onStockEditPageAssignSourceToStock2"> |
| 82 | + <argument name="filter_selector" value="AdminManageStockGridFilterControls.name"/> |
| 83 | + <argument name="filter_value" value="$$createSource2.source[name]$$"/> |
| 84 | + </actionGroup> |
| 85 | + <actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="saveAndClose1"/> |
| 86 | + |
| 87 | + <!--Go to product and open product to edit--> |
| 88 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage"> |
| 89 | + <argument name="productId" value="$createSimpleProduct.id$"/> |
| 90 | + </actionGroup> |
| 91 | + |
| 92 | + <!--Add category to product--> |
| 93 | + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignProduct"> |
| 94 | + <argument name="categoryName" value="$$category.name$$"/> |
| 95 | + </actionGroup> |
| 96 | + |
| 97 | + <!--Assign Source to product and update quantity--> |
| 98 | + <actionGroup ref="AdminOnProductEditPageAssignSourceToProduct" stepKey="AdminOnProductEditPageAssignSourceToProduct1"> |
| 99 | + <argument name="filter_selector" value="AdminManageSourcesGridFilterControls.code"/> |
| 100 | + <argument name="filter_value" value="$$createSource1.source[source_code]$$"/> |
| 101 | + </actionGroup> |
| 102 | + <actionGroup ref="AdminOnProductEditPageAssignSourceToProduct" stepKey="AdminOnProductEditPageAssignSourceToProduct2"> |
| 103 | + <argument name="filter_selector" value="AdminManageSourcesGridFilterControls.code"/> |
| 104 | + <argument name="filter_value" value="$$createSource2.source[source_code]$$"/> |
| 105 | + </actionGroup> |
| 106 | + |
| 107 | + <fillField selector="{{AdminProductSourcesGrid.rowQty('1')}}" userInput="100" stepKey="fillDefaultQuantityField1"/> |
| 108 | + <fillField selector="{{AdminProductSourcesGrid.rowQty('2')}}" userInput="100" stepKey="fillDefaultQuantityField2"/> |
| 109 | + |
| 110 | + <!--Save the product--> |
| 111 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> |
| 112 | + |
| 113 | + <!-- Login as customer --> |
| 114 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> |
| 115 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 116 | + </actionGroup> |
| 117 | + |
| 118 | + <!--Open product in storefront--> |
| 119 | + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPageOnStorefront"/> |
| 120 | + <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> |
| 121 | + |
| 122 | + <!--Add product to cart--> |
| 123 | + <actionGroup ref="StorefrontAddSimpleProductWithQtyActionGroup" stepKey="addSimpleProductToCart"> |
| 124 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 125 | + <argument name="quantity" value="5"/> |
| 126 | + </actionGroup> |
| 127 | + |
| 128 | + <!-- Grab Quantity Value from PDP--> |
| 129 | + <grabValueFrom selector="{{StorefrontProductPageSection.qtyInput($$createSimpleProduct.name$$)}}" stepKey="grabProductQtyInPDP"/> |
| 130 | + <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickMiniCart"/> |
| 131 | + |
| 132 | + <!-- Grab Quantity Value from MiniCart--> |
| 133 | + <grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createSimpleProduct.name$$)}}" stepKey="grabProductQtyInShowMinicart"/> |
| 134 | + |
| 135 | + <!-- Assert Quantity value equals 1 --> |
| 136 | + <assertEquals stepKey="assertquantityValuesAreEqualfromProductPage"> |
| 137 | + <actualResult type="string">$grabProductQtyInShowMinicart</actualResult> |
| 138 | + <expectedResult type="string">$grabProductQtyInPDP</expectedResult> |
| 139 | + </assertEquals> |
| 140 | + |
| 141 | + <!--Click on Proceed to checkout--> |
| 142 | + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> |
| 143 | + <waitForPageLoad stepKey="waitForPageLoad2"/> |
| 144 | + |
| 145 | + <actionGroup ref="StorefrontPickInStoreActionGroup" stepKey="pickInStore"/> |
| 146 | + <actionGroup ref="StorefrontPickInStoreNavigateToSelectStoreActionGroup" stepKey="navigateToSelectStores"/> |
| 147 | + <!--<actionGroup ref="StorefrontPickInStoreSelectSourceActionGroup" stepKey="selectSource"> |
| 148 | + <argument name="searchString" value="{{CulverStorePickupEnabledSource2.city}}"/> |
| 149 | + <argument name="sourceName" value="$createSource1.source[name]$"/> |
| 150 | + </actionGroup>--> |
| 151 | + <fillField selector="{{StorefrontPickInStoreModalSection.search}}" userInput="{{CulverStorePickupEnabledSource2.city}}" stepKey="fillSearchField"/> |
| 152 | + <clearField selector="{{StorefrontPickInStoreModalSection.search}}" stepKey="resetToDefaultPricePrintedCard"/> |
| 153 | + <wait stepKey="waitBeforeIndexerAfterBundle" time="30"/> |
| 154 | + |
| 155 | + <!--Click on ship here for source--> |
| 156 | + <click selector="{{StorefrontPickInStoreModalSection.shipBtn($$createSource1.source[name]$$)}}" stepKey="clickShipBtn"/> |
| 157 | + <waitForPageLoad stepKey="waitForSourceSelection"/> |
| 158 | + |
| 159 | + <!--Navigate to Payment--> |
| 160 | + <actionGroup ref="StorefrontPickInStoreNavigateToPaymentActionGroup" stepKey="navigateToPaymentStep"/> |
| 161 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="clickCheckMoneyOrderPayment"/> |
| 162 | + |
| 163 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> |
| 164 | + <waitForPageLoad stepKey="waitForSuccess"/> |
| 165 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="orderNumber"/> |
| 166 | + |
| 167 | + <!--Open recently submitted order--> |
| 168 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> |
| 169 | + <argument name="orderId" value="{$orderNumber}"/> |
| 170 | + </actionGroup> |
| 171 | + |
| 172 | + <!--Verify ship is not present and Notify Order Is Ready For Pickup --> |
| 173 | + <actionGroup ref="AdminAssertOrderWithStorePickupShippingMethodActionGroup" stepKey="verifyShippingInformation"> |
| 174 | + <argument name="sourceName" value="$createSource1.source[name]$"/> |
| 175 | + </actionGroup> |
| 176 | + </test> |
| 177 | +</tests> |
0 commit comments