Skip to content

Commit

Permalink
MAGETWO-91465:Once integer is stored for State/Province field, it can…
Browse files Browse the repository at this point in the history
… not be changed to alphanumeric

-Added functional test to cover bug fix
  • Loading branch information
devpatil7 committed Jul 12, 2018
1 parent 54f2fd6 commit 2099950
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
<element name="next" type="button" selector="button.button.action.continue.primary" timeout="30"/>
<element name="firstShippingMethod" type="radio" selector="//*[@id='checkout-shipping-method-load']//input[@class='radio']"/>
<element name="defaultShipping" type="button" selector=".billing-address-details"/>
<element name="stateInput" type="input" selector="input[name=region]"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
<test name="AddressStateFieldShouldNotAcceptJustIntegerValuesTest">
<annotations>
<features value="Checkout"/>
<stories value="MAGETWO-91465"/>
<title value="Guest Checkout"/>
<description value="Address State field should not allow just integer values"/>
<severity value="MAJOR"/>
<testCaseId value="MAGETWO-93203"/>
<group value="checkout"/>
</annotations>
<before>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="ApiSimpleProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
</after>

<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/>
<click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/>
<waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/>
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/>
<see selector="{{StorefrontMinicartSection.quantity}}" userInput="1" stepKey="seeCartQuantity"/>
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart" />
<selectOption stepKey="selectCounty" selector="{{CheckoutShippingSection.country}}" userInput="{{UK_Address.country_id}}"/>
<waitForPageLoad stepKey="waitFormToReload"/>
<fillField selector="{{CheckoutShippingSection.stateInput}}" userInput="1" stepKey="enterStateAsIntegerValue"/>
<waitForPageLoad stepKey="waitforFormValidation"/>
<see userInput="First character must be letter." stepKey="seeTheErrorMessageDisplayed"/>
<fillField selector="{{CheckoutShippingSection.stateInput}}" userInput=" 1" stepKey="enterStateAsIntegerValue1"/>
<waitForPageLoad stepKey="waitforFormValidation1"/>
<see userInput="First character must be letter." stepKey="seeTheErrorMessageDisplayed1"/>
<fillField selector="{{CheckoutShippingSection.stateInput}}" userInput="ABC1" stepKey="enterStateAsIntegerValue2"/>
<waitForPageLoad stepKey="waitforFormValidation2"/>
<dontSee userInput="First character must be letter." stepKey="seeTheErrorMessageIsNotDisplayed"/>
</test>
</tests>
4 changes: 4 additions & 0 deletions app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,8 @@
<data key="default_shipping">Yes</data>
<requiredEntity type="region">RegionCA</requiredEntity>
</entity>
<!--If required other field can be added to UK_Address entity, dont modify any existing data-->
<entity name="UK_Address" type="address">
<data key="country_id">GB</data>
</entity>
</entities>

0 comments on commit 2099950

Please sign in to comment.