|
| 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="AdminVerifyStateProvinceRequiredOnAddingNewAddressPageTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Backend"/> |
| 14 | + <stories value="Verification of required fields on new address page test"/> |
| 15 | + <title value="Admin verifies State/Province should be required fields on add new address page test"/> |
| 16 | + <description value="Admin verifies State/Province should be required fields on add new address page test"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-3912"/> |
| 19 | + <group value="configuration"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Set locale options to United Kingdom--> |
| 23 | + <magentoCLI stepKey="localeUK" command="config:set general/locale/code en_GB"/> |
| 24 | + <!-- Deploy static content with United Kingdom locale--> |
| 25 | + <magentoCLI command="setup:static-content:deploy en_GB" stepKey="deployStaticContentWithUnitedKingdomLocale"/> |
| 26 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 27 | + </before> |
| 28 | + <after> |
| 29 | + <!-- Set locale options to en_US--> |
| 30 | + <magentoCLI stepKey="localeUS" command="config:set general/locale/code en_US"/> |
| 31 | + <!-- Change Admin locale to default --> |
| 32 | + <actionGroup ref="SetAdminAccountActionGroup" stepKey="setAdminAccountToUnitedStates"> |
| 33 | + <argument name="InterfaceLocaleByValue" value="en_US" /> |
| 34 | + </actionGroup> |
| 35 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 36 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 37 | + <argument name="indices" value=""/> |
| 38 | + </actionGroup> |
| 39 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> |
| 40 | + <argument name="tags" value=""/> |
| 41 | + </actionGroup> |
| 42 | + </after> |
| 43 | + |
| 44 | + <!-- Open Admin Store Configuration Page --> |
| 45 | + <actionGroup ref="AdminOpenStoreConfigPageActionGroup" stepKey="openStoreConfigPage" /> |
| 46 | + |
| 47 | + <!--"Choose United Kingdom" as State Option Required and save configuration --> |
| 48 | + <conditionalClick selector="{{StateOptionsSection.stateOptions}}" dependentSelector="{{StateOptionsSection.countriesWithRequiredRegions}}" visible="false" stepKey="expandStateOptionsTab"/> |
| 49 | + <waitForAjaxLoad stepKey="waitForAjax"/> |
| 50 | + <scrollTo selector="{{StateOptionsSection.countriesWithRequiredRegions}}" stepKey="scrollToForm"/> |
| 51 | + <selectOption selector="{{StateOptionsSection.countriesWithRequiredRegions}}" userInput="United Kingdom" stepKey="selectCountriesWithRequiredRegion"/> |
| 52 | + <click selector="#save" stepKey="saveStateOptionsConfig"/> |
| 53 | + <waitForPageLoad stepKey="waitForSavingConfig"/> |
| 54 | + |
| 55 | + <!-- create customer on storefront --> |
| 56 | + <actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/> |
| 57 | + <actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/> |
| 58 | + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm"> |
| 59 | + <argument name="customer" value="Simple_US_Customer"/> |
| 60 | + </actionGroup> |
| 61 | + <actionGroup ref="StorefrontClickCreateAnAccountCustomerAccountCreationFormActionGroup" stepKey="submitCreateAccountForm"/> |
| 62 | + |
| 63 | + <!-- Open AddressBook and set Country as "United Kingdom" --> |
| 64 | + <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToAddressBookPage"> |
| 65 | + <argument name="menu" value="Address Book"/> |
| 66 | + </actionGroup> |
| 67 | + |
| 68 | + <!-- Choose Country as "United Kingdom" --> |
| 69 | + <selectOption selector="{{StorefrontCustomerAddressFormSection.country}}" userInput="United Kingdom" stepKey="selectCountry"/> |
| 70 | + <click selector="{{StorefrontCustomerAddressFormSection.saveAddress}}" stepKey="saveCustomerAddress"/> |
| 71 | + |
| 72 | + <!-- Assert the error message --> |
| 73 | + <seeElement selector="{{StorefrontCustomerMessagesSection.assertErrorMessage}}" stepKey="assetErrorMessage"/> |
| 74 | + </test> |
| 75 | +</tests> |
0 commit comments