|
| 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="AdminAlterCustomerAddressAttributeTest"> |
| 12 | + <annotations> |
| 13 | + <features value="CustomerCustomAttributes"/> |
| 14 | + <stories value="Register customer with custom attribute"/> |
| 15 | + <title value="Admin Alter Customer Address Attribute"/> |
| 16 | + <description value="Admin Alter Customer Address Attribute"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-3962"/> |
| 19 | + <group value="customerCustomAttributes"/> |
| 20 | + <group value="customer"/> |
| 21 | + </annotations> |
| 22 | + |
| 23 | + <before> |
| 24 | + <!-- create customer --> |
| 25 | + <createData entity="CustomerEntityOne" stepKey="createCustomer"/> |
| 26 | + <!-- create category --> |
| 27 | + <createData entity="_defaultCategory" stepKey="testCategory"/> |
| 28 | + <!-- create data --> |
| 29 | + <createData entity="_defaultProduct" stepKey="testProduct"> |
| 30 | + <requiredEntity createDataKey="testCategory"/> |
| 31 | + </createData> |
| 32 | + <!-- Assign Product to Category --> |
| 33 | + <createData entity="AssignProductToCategory" stepKey="assignTestCategoryToTestProduct"> |
| 34 | + <requiredEntity createDataKey="testCategory"/> |
| 35 | + <requiredEntity createDataKey="testProduct"/> |
| 36 | + </createData> |
| 37 | + </before> |
| 38 | + <after> |
| 39 | + <!-- delete category,product,customer --> |
| 40 | + <deleteData createDataKey="testProduct" stepKey="deleteSimpleProduct"/> |
| 41 | + <deleteData createDataKey="testCategory" stepKey="deleteSimpleCategory"/> |
| 42 | + <deleteData createDataKey="createCustomer" stepKey="deleteGloCustomer"/> |
| 43 | + </after> |
| 44 | + |
| 45 | + <!-- Log in to admin --> |
| 46 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 47 | + <!-- Go to customer attributes page --> |
| 48 | + <actionGroup ref="AdminNavigateToCustomerAddressAttributesPageActionGroup" stepKey="navigateToCustomerAttributes"/> |
| 49 | + |
| 50 | + <!-- Open "street" attribute --> |
| 51 | + <actionGroup ref="AdminOpenCustomerAddressAttributeByCodeActionGroup" stepKey="street"> |
| 52 | + <argument name="attributeCode" value="street"/> |
| 53 | + </actionGroup> |
| 54 | + |
| 55 | + <!-- Edit line Count to 4--> |
| 56 | + <fillField selector="{{AdminCustomerAttributeEditSection.streetAddress}}" userInput="4" stepKey="fillLinesCount"/> |
| 57 | + |
| 58 | + <!-- Save the attribute --> |
| 59 | + <click selector="{{CustomerAccountSection.save}}" stepKey="saveAttribute"/> |
| 60 | + <waitForPageLoad stepKey="WaitForAttributeSaved"/> |
| 61 | + |
| 62 | + <!-- Open the customer edit page --> |
| 63 | + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="goToCustomerEditPage"> |
| 64 | + <argument name="customerId" value="$createCustomer.id$"/> |
| 65 | + </actionGroup> |
| 66 | + |
| 67 | + <!-- Switch the addresses tab --> |
| 68 | + <actionGroup ref="AdminOpenAddressesTabFromCustomerEditPageActionGroup" stepKey="openAddressesTab"/> |
| 69 | + |
| 70 | + <!--Open created customer details page and change address --> |
| 71 | + <actionGroup ref="OpenEditCustomerAddressFromAdminActionGroup" stepKey="editCustomerAddress"> |
| 72 | + <argument name="address" value="CustomerAddressSimple"/> |
| 73 | + </actionGroup> |
| 74 | + |
| 75 | + <!-- Update Address Depending on the line count --> |
| 76 | + <seeElement selector="{{AdminCustomerAddressFiltersSection.streetLineCount('0')}}" stepKey="seeFirstField"/> |
| 77 | + <fillField selector="{{AdminCustomerAddressFiltersSection.streetLineCount('0')}}" userInput="8181" stepKey="fillFirstAddress"/> |
| 78 | + |
| 79 | + <seeElement selector="{{AdminCustomerAddressFiltersSection.streetLineCount('1')}}" stepKey="seeSecondField"/> |
| 80 | + <fillField selector="{{AdminCustomerAddressFiltersSection.streetLineCount('1')}}" userInput="3204" stepKey="fillSecondAddress"/> |
| 81 | + |
| 82 | + <seeElement selector="{{AdminCustomerAddressFiltersSection.streetLineCount('2')}}" stepKey="seeThirdField"/> |
| 83 | + <fillField selector="{{AdminCustomerAddressFiltersSection.streetLineCount('2')}}" userInput="Kooter" stepKey="fillThirdAddress"/> |
| 84 | + |
| 85 | + <seeElement selector="{{AdminCustomerAddressFiltersSection.streetLineCount('3')}}" stepKey="seeFourthField"/> |
| 86 | + <fillField selector="{{AdminCustomerAddressFiltersSection.streetLineCount('3')}}" userInput="Lane" stepKey="fillFourthAddress"/> |
| 87 | + |
| 88 | + <click selector="{{AdminEditCustomerAddressesSection.save}}" stepKey="clickOnSaveButton"/> |
| 89 | + <waitForPageLoad stepKey="waitForPageToBeSaved"/> |
| 90 | + |
| 91 | + <!-- Open Storefront and login as customer --> |
| 92 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> |
| 93 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 94 | + </actionGroup> |
| 95 | + |
| 96 | + <!-- Open My Account Page from Customer dropdown --> |
| 97 | + <actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToMyAccountPage"/> |
| 98 | + |
| 99 | + <amOnPage url="{{StorefrontCustomerAddressesPage.url}}" stepKey="OpenCustomerAddNewAddress"/> |
| 100 | + |
| 101 | + <!-- Change shipping address --> |
| 102 | + <actionGroup ref="StoreFrontClickEditDefaultShippingAddressActionGroup" stepKey="clickEditShippingAddress"/> |
| 103 | + |
| 104 | + <!-- Update Address Depending on the line count --> |
| 105 | + <seeElement selector="{{StorefrontCustomerAddressFormSection.streetLineCount('0')}}" stepKey="seeCustomerFirstField"/> |
| 106 | + <fillField selector="{{StorefrontCustomerAddressFormSection.streetLineCount('0')}}" userInput="8181" stepKey="fillCustomerFirstAddress"/> |
| 107 | + |
| 108 | + <seeElement selector="{{StorefrontCustomerAddressFormSection.streetLineCount('2')}}" stepKey="seeCustomerSecondField"/> |
| 109 | + <fillField selector="{{StorefrontCustomerAddressFormSection.streetLineCount('2')}}" userInput="3204" stepKey="fillCustomerSecondAddress"/> |
| 110 | + |
| 111 | + <seeElement selector="{{StorefrontCustomerAddressFormSection.streetLineCount('3')}}" stepKey="seeCustomerThirdField"/> |
| 112 | + <fillField selector="{{StorefrontCustomerAddressFormSection.streetLineCount('3')}}" userInput="Kooter" stepKey="fillCustomerThirdAddress"/> |
| 113 | + |
| 114 | + <seeElement selector="{{StorefrontCustomerAddressFormSection.streetLineCount('4')}}" stepKey="seeCustomerFourthField"/> |
| 115 | + <fillField selector="{{StorefrontCustomerAddressFormSection.streetLineCount('4')}}" userInput="Lane" stepKey="fillCustomerFourthAddress"/> |
| 116 | + |
| 117 | + <!-- Save Customer Address --> |
| 118 | + <actionGroup ref="AdminSaveCustomerAddressActionGroup" stepKey="saveAddress"/> |
| 119 | + |
| 120 | + <!-- Customer placed order from storefront with payment method --> |
| 121 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 122 | + <argument name="product" value="$testProduct$"/> |
| 123 | + </actionGroup> |
| 124 | + |
| 125 | + <!-- Place an Order from Customer StoreFront --> |
| 126 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> |
| 127 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFlatRate"/> |
| 128 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentStep"/> |
| 129 | + |
| 130 | + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"> |
| 131 | + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> |
| 132 | + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> |
| 133 | + </actionGroup> |
| 134 | + |
| 135 | + </test> |
| 136 | +</tests> |
0 commit comments