|
| 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="StorefrontVerifyZipCodeWorkingAsPerCountryTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Checkout"/> |
| 14 | + <stories value="Guest checkout"/> |
| 15 | + <title value="Storefront Verify ZipCode Working As Per Country"/> |
| 16 | + <description value="Storefront Verify ZipCode Working As Per Country"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4016"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- create category --> |
| 22 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 23 | + <!-- create simple product --> |
| 24 | + <createData entity="ApiSimpleProduct" stepKey="createProduct"> |
| 25 | + <requiredEntity createDataKey="createCategory"/> |
| 26 | + </createData> |
| 27 | + </before> |
| 28 | + <after> |
| 29 | + <!-- delete category --> |
| 30 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 31 | + <!-- delete simple product --> |
| 32 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 33 | + </after> |
| 34 | + |
| 35 | + <!-- Step 1: Go to Storefront as Guest --> |
| 36 | + <!-- Step 2: Add simple product to shopping cart --> |
| 37 | + <amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="amOnSimpleProductPage"/> |
| 38 | + <waitForPageLoad stepKey="waitForPageLoad2"/> |
| 39 | + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="cartAddSimpleProductToCart"> |
| 40 | + <argument name="productName" value="$createProduct.name$"/> |
| 41 | + </actionGroup> |
| 42 | + <!-- Proceed to Checkout --> |
| 43 | + <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickToOpenCard"/> |
| 44 | + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="clickToProceedToCheckout"/> |
| 45 | + <waitForPageLoad stepKey="waitForTheFormIsOpened"/> |
| 46 | + <!-- verify shipping screen is opened --> |
| 47 | + <seeElement selector="{{CheckoutShippingSection.isShippingStep}}" stepKey="shippingStepIsOpened"/> |
| 48 | + <!-- Enter invalid zip code as "1" --> |
| 49 | + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="1" stepKey="SetCustomerZipCode"/> |
| 50 | + <!-- wait for JS error message to appear --> |
| 51 | + <waitForElementVisible selector="{{CheckoutShippingSection.invalidPostcodeJSError}}" stepKey="waitForElementVisible"/> |
| 52 | + <see selector="{{CheckoutShippingSection.invalidPostcodeJSError}}" userInput="Provided Zip/Postal Code seems to be invalid. Example: 12345-6789; 12345. If you believe it is the right one you can ignore this notice." stepKey="seeErrorMessage"/> |
| 53 | + |
| 54 | + <!-- Enter valid zip code as "12345-6789" --> |
| 55 | + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="12345-6789" stepKey="SetCustomerZipCode123456789"/> |
| 56 | + <!-- wait for JS error message to disappear --> |
| 57 | + <waitForElementNotVisible selector="{{CheckoutShippingSection.invalidPostcodeJSError}}" stepKey="waitForElementNotVisible"/> |
| 58 | + <!-- Enter invalid zip code as "abc" --> |
| 59 | + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="abc" stepKey="SetCustomerZipCodeabc"/> |
| 60 | + |
| 61 | + <!-- wait for JS error message to appear --> |
| 62 | + <waitForElementVisible selector="{{CheckoutShippingSection.invalidPostcodeJSError}}" stepKey="waitForJSElementMessageVisible"/> |
| 63 | + <see selector="{{CheckoutShippingSection.invalidPostcodeJSError}}" userInput="Provided Zip/Postal Code seems to be invalid. Example: 12345-6789; 12345. If you believe it is the right one you can ignore this notice." stepKey="seeJSErrorMessage"/> |
| 64 | + <!-- change country as United Kingdom" --> |
| 65 | + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{updateCustomerUKAddress.country_id}}" stepKey="selectCountry"/> |
| 66 | + <!-- Enter valid zip code as "A12 3BC" --> |
| 67 | + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="A12 3BC" stepKey="SetCustomerZipCodeA123BC"/> |
| 68 | + <!-- wait for JS error message to disappear --> |
| 69 | + <waitForElementNotVisible selector="{{CheckoutShippingSection.invalidPostcodeJSError}}" stepKey="waitForJSErrorElementNotVisible"/> |
| 70 | + </test> |
| 71 | +</tests> |
0 commit comments