|
| 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="VerifyThatOptionAllowToChooseStateIfItIsOptionalForCountryIsApplicableForCheckoutFlowTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Checkout"/> |
| 14 | + <stories value="Verify that option Allow to Choose State if It is Optional for Country is applicable for checkout flow"/> |
| 15 | + <title value="Verify that option Allow to Choose State if It is Optional for Country is applicable for checkout flow"/> |
| 16 | + <description value="Verify that option Allow to Choose State if It is Optional for Country is applicable for checkout flow"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4588"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/> |
| 22 | + <actionGroup ref="AdminAllowToChooseStateActionGroup" stepKey="disableAllowState"> |
| 23 | + <argument name="fieldValue" value="0"/> |
| 24 | + </actionGroup> |
| 25 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 26 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 30 | + <magentoCLI command="config:set {{EnablePaymentCheckMOConfigData.path}} {{EnablePaymentCheckMOConfigData.value}}" stepKey="enableCheckMoneyOrderPayment"/> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <actionGroup ref="AdminAllowToChooseStateActionGroup" stepKey="enableAllowState"> |
| 34 | + <argument name="fieldValue" value="1"/> |
| 35 | + </actionGroup> |
| 36 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 37 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 38 | + <magentoCLI stepKey="reindex" command="indexer:reindex"/> |
| 39 | + <magentoCLI stepKey="flushCache" command="cache:flush"/> |
| 40 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 41 | + </after> |
| 42 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPageOnStorefront"/> |
| 43 | + <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> |
| 44 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 45 | + <argument name="product" value="$$createProduct$$" /> |
| 46 | + <argument name="productCount" value="1" /> |
| 47 | + </actionGroup> |
| 48 | + <!-- go to shopping cart and asser states --> |
| 49 | + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart" /> |
| 50 | + <click selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" stepKey="openEstimateTaxSection"/> |
| 51 | + <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="United States" stepKey="selectUSCountry"/> |
| 52 | + <seeElement selector="{{CheckoutCartSummarySection.stateProvince}}" stepKey="assertUSStateProvince"/> |
| 53 | + <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="Tajikistan" stepKey="selectTJKCountry"/> |
| 54 | + <dontSeeElement selector="{{CheckoutCartSummarySection.stateProvince}}" stepKey="dontSeeTJKStateProvince"/> |
| 55 | + <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="France" stepKey="selectFRCountry"/> |
| 56 | + <dontSeeElement selector="{{CheckoutCartSummarySection.stateProvince}}" stepKey="dontSeeFRStateProvince"/> |
| 57 | + <!-- go to shipping page and assert states --> |
| 58 | + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> |
| 59 | + <selectOption selector="{{CheckoutShippingGuestInfoSection.country}}" userInput="Tajikistan" stepKey="selectTJCountry"/> |
| 60 | + <dontSeeElement selector="{{CheckoutShippingGuestInfoSection.region}}" stepKey="dontSeeTJStateProvince"/> |
| 61 | + <selectOption selector="{{CheckoutShippingGuestInfoSection.country}}" userInput="France" stepKey="selectFranceCountry"/> |
| 62 | + <dontSeeElement selector="{{CheckoutShippingGuestInfoSection.region}}" stepKey="dontSeeFranceStateProvince"/> |
| 63 | + <selectOption selector="{{CheckoutShippingGuestInfoSection.country}}" userInput="United States" stepKey="selectUStatesCountry"/> |
| 64 | + <seeElement selector="{{CheckoutShippingGuestInfoSection.region}}" stepKey="seeUSStateProvince"/> |
| 65 | + <actionGroup ref="FillGuestCheckoutShippingAddressWithCountryAndStateActionGroup" stepKey="fillGuestShippingFormData"> |
| 66 | + <argument name="customer" value="CustomerEntityOne"/> |
| 67 | + <argument name="customerAddress" value="CustomerAddressSimple"/> |
| 68 | + </actionGroup> |
| 69 | + <actionGroup ref="StorefrontSelectFirstShippingMethodActionGroup" stepKey="selectFirstShippingMethod"/> |
| 70 | + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/> |
| 71 | + <!-- Checkout select Check/Money Order payment --> |
| 72 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> |
| 73 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> |
| 74 | + </test> |
| 75 | +</tests> |
0 commit comments