|
| 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="AdminCreatingShippingLabelTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Fedex"/> |
| 14 | + <stories value="Shipping label"/> |
| 15 | + <title value="Creating shipping label"/> |
| 16 | + <description value="Creating shipping label"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MC-20287"/> |
| 19 | + <useCaseId value="MC-18215"/> |
| 20 | + <group value="shipping"/> |
| 21 | + <skip> |
| 22 | + <issueId value="MQE-1578"/> |
| 23 | + </skip> |
| 24 | + </annotations> |
| 25 | + <before> |
| 26 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 27 | + <!-- Create product --> |
| 28 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 29 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 30 | + <requiredEntity createDataKey="createCategory"/> |
| 31 | + </createData> |
| 32 | + <!--Set Fedex configs data--> |
| 33 | + <magentoCLI command="config:set {{AdminFedexEnableForCheckoutConfigData.path}} {{AdminFedexEnableForCheckoutConfigData.value}}" stepKey="enableCheckout"/> |
| 34 | + <magentoCLI command="config:set {{AdminFedexEnableSandboxModeConfigData.path}} {{AdminFedexEnableSandboxModeConfigData.value}}" stepKey="enableSandbox"/> |
| 35 | + <magentoCLI command="config:set {{AdminFedexEnableDebugConfigData.path}} {{AdminFedexEnableDebugConfigData.value}}" stepKey="enableDebug"/> |
| 36 | + <magentoCLI command="config:set {{AdminFedexEnableShowMethodConfigData.path}} {{AdminFedexEnableShowMethodConfigData.value}}" stepKey="enableShowMethod"/> |
| 37 | + <!--TODO: add fedex credentials--> |
| 38 | + <!--Set StoreInformation configs data--> |
| 39 | + <magentoCLI command="config:set {{AdminGeneralSetStoreNameConfigData.path}} '{{AdminGeneralSetStoreNameConfigData.value}}'" stepKey="setStoreInformationName"/> |
| 40 | + <magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.telephone}}" stepKey="setStoreInformationPhone"/> |
| 41 | + <magentoCLI command="config:set {{AdminGeneralSetCountryConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.country_id}}" stepKey="setStoreInformationCountry"/> |
| 42 | + <magentoCLI command="config:set {{AdminGeneralSetCityConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.city}}" stepKey="setStoreInformationCity"/> |
| 43 | + <magentoCLI command="config:set {{AdminGeneralSetPostcodeConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.postcode}}" stepKey="setStoreInformationPostcode"/> |
| 44 | + <magentoCLI command="config:set {{AdminGeneralSetStreetAddressConfigData.path}} '{{DE_Address_Berlin_Not_Default_Address.street[0]}}'" stepKey="setStoreInformationStreetAddress"/> |
| 45 | + <magentoCLI command="config:set {{AdminGeneralSetStreetAddress2ConfigData.path}} '{{US_Address_California.street[0]}}'" stepKey="setStoreInformationStreetAddress2"/> |
| 46 | + <magentoCLI command="config:set {{AdminGeneralSetVatNumberConfigData.path}} {{AdminGeneralSetVatNumberConfigData.value}}" stepKey="setStoreInformationVatNumber"/> |
| 47 | + <!--Set Shipping settings origin data--> |
| 48 | + <magentoCLI command="config:set {{AdminShippingSettingsOriginCountryConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.country_id}}" stepKey="setOriginCountry"/> |
| 49 | + <magentoCLI command="config:set {{AdminShippingSettingsOriginCityConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.city}}" stepKey="setOriginCity"/> |
| 50 | + <magentoCLI command="config:set {{AdminShippingSettingsOriginZipCodeConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.postcode}}" stepKey="setOriginZipCode"/> |
| 51 | + <magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddressConfigData.path}} '{{DE_Address_Berlin_Not_Default_Address.street[0]}}'" stepKey="setOriginStreetAddress"/> |
| 52 | + <magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddress2ConfigData.path}} '{{US_Address_California.street[0]}}'" stepKey="setOriginStreetAddress2"/> |
| 53 | + <magentoCLI command="indexer:reindex" stepKey="reindex"/> |
| 54 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 55 | + </before> |
| 56 | + <after> |
| 57 | + <!--Reset configs--> |
| 58 | + <magentoCLI command="config:set {{AdminFedexDisableForCheckoutConfigData.path}} {{AdminFedexDisableForCheckoutConfigData.value}}" stepKey="disableCheckout"/> |
| 59 | + <magentoCLI command="config:set {{AdminFedexDisableSandboxModeConfigData.path}} {{AdminFedexDisableSandboxModeConfigData.value}}" stepKey="disableSandbox"/> |
| 60 | + <magentoCLI command="config:set {{AdminFedexDisableDebugConfigData.path}} {{AdminFedexDisableDebugConfigData.value}}" stepKey="disableDebug"/> |
| 61 | + <magentoCLI command="config:set {{AdminFedexDisableShowMethodConfigData.path}} {{AdminFedexDisableShowMethodConfigData.value}}" stepKey="disableShowMethod"/> |
| 62 | + <magentoCLI command="config:set {{AdminGeneralSetStoreNameConfigData.path}} ''" stepKey="setStoreInformationName"/> |
| 63 | + <magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} ''" stepKey="setStoreInformationPhone"/> |
| 64 | + <magentoCLI command="config:set {{AdminGeneralSetCityConfigData.path}} ''" stepKey="setStoreInformationCity"/> |
| 65 | + <magentoCLI command="config:set {{AdminGeneralSetPostcodeConfigData.path}} ''" stepKey="setStoreInformationPostcode"/> |
| 66 | + <magentoCLI command="config:set {{AdminGeneralSetStreetAddressConfigData.path}} ''" stepKey="setStoreInformationStreetAddress"/> |
| 67 | + <magentoCLI command="config:set {{AdminGeneralSetStreetAddress2ConfigData.path}} ''" stepKey="setStoreInformationStreetAddress2"/> |
| 68 | + <magentoCLI command="config:set {{AdminGeneralSetVatNumberConfigData.path}} ''" stepKey="setStoreInformationVatNumber"/> |
| 69 | + <magentoCLI command="config:set {{AdminShippingSettingsOriginCityConfigData.path}} ''" stepKey="setOriginCity"/> |
| 70 | + <magentoCLI command="config:set {{AdminShippingSettingsOriginZipCodeConfigData.path}} ''" stepKey="setOriginZipCode"/> |
| 71 | + <magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddressConfigData.path}} ''" stepKey="setOriginStreetAddress"/> |
| 72 | + <magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddress2ConfigData.path}} ''" stepKey="setOriginStreetAddress2"/> |
| 73 | + <magentoCLI command="indexer:reindex" stepKey="reindex"/> |
| 74 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 75 | + <!--Delete created data--> |
| 76 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 77 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 78 | + <actionGroup ref="logout" stepKey="logout"/> |
| 79 | + </after> |
| 80 | + <!--Add country of manufacture to product--> |
| 81 | + <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="amOnEditPage"/> |
| 82 | + <waitForPageLoad stepKey="waitForEditPage"/> |
| 83 | + <actionGroup ref="AdminFillProductCountryOfManufactureActionGroup" stepKey="fillCountryOfManufacture"> |
| 84 | + <argument name="countryId" value="DE"/> |
| 85 | + </actionGroup> |
| 86 | + <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> |
| 87 | + <!--Place for order using FedEx shipping method--> |
| 88 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnStorefrontProductPage"/> |
| 89 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 90 | + <argument name="product" value="$$createProduct$$"/> |
| 91 | + <argument name="productCount" value="1"/> |
| 92 | + </actionGroup> |
| 93 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> |
| 94 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="addAddress"> |
| 95 | + <argument name="customerVar" value="Simple_US_Utah_Customer"/> |
| 96 | + <argument name="customerAddressVar" value="US_Address_California"/> |
| 97 | + <argument name="shippingMethod" value="Federal Express"/> |
| 98 | + </actionGroup> |
| 99 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> |
| 100 | + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="customerPlaceOrder"> |
| 101 | + <argument name="orderNumberMessage" value="CONST.successGuestCheckoutOrderNumberMessage"/> |
| 102 | + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> |
| 103 | + </actionGroup> |
| 104 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> |
| 105 | + <!--Open created order in admin--> |
| 106 | + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> |
| 107 | + <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchOrder"> |
| 108 | + <argument name="keyword" value="$grabOrderNumber"/> |
| 109 | + </actionGroup> |
| 110 | + <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> |
| 111 | + <!--Create Invoice--> |
| 112 | + <actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createInvoice"/> |
| 113 | + <!--Create shipping label--> |
| 114 | + <actionGroup ref="goToShipmentIntoOrder" stepKey="goToShipmentIntoOrder"/> |
| 115 | + <checkOption selector="{{AdminShipmentTotalSection.createShippingLabel}}" stepKey="checkCreateShippingLabel"/> |
| 116 | + <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> |
| 117 | + <actionGroup ref="AdminShipmentCreateShippingLabelActionGroup" stepKey="createPackage"> |
| 118 | + <argument name="productName" value="$$createProduct.name$$"/> |
| 119 | + </actionGroup> |
| 120 | + <actionGroup ref="AdminGoToShipmentTabActionGroup" stepKey="goToShipmentTab"/> |
| 121 | + <click selector="{{AdminOrderShipmentsTabSection.viewGridRow('1')}}" stepKey="clickRowToViewShipment"/> |
| 122 | + <waitForPageLoad stepKey="waitForShipmentItemsSection"/> |
| 123 | + <seeElement selector="{{AdminShipmentTrackingInformationShippingSection.shippingInfoTable}}" stepKey="seeInformationTable"/> |
| 124 | + <seeElement selector="{{AdminShipmentTrackingInformationShippingSection.shippingNumber}}" stepKey="seeShippingNumberElement"/> |
| 125 | + <grabTextFrom selector="{{AdminShipmentTrackingInformationShippingSection.shippingMethod}}" stepKey="grabShippingMethod"/> |
| 126 | + <grabTextFrom selector="{{AdminShipmentTrackingInformationShippingSection.shippingMethodTitle}}" stepKey="grabShippingMethodTitle"/> |
| 127 | + <assertEquals actual="$grabShippingMethod" expectedType="string" expected="Federal Express" stepKey="assertShippingMethodIsFedEx"/> |
| 128 | + <assertEquals actual="$grabShippingMethodTitle" expectedType="string" expected="Federal Express" stepKey="assertShippingMethodTitleIsFedEx"/> |
| 129 | + </test> |
| 130 | +</tests> |
0 commit comments