|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="ShippingQuotePersistedForGuestTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Persistent"/> |
| 13 | + <stories value="Guest checkout"/> |
| 14 | + <title value="Estimate Shipping and Tax block sections on shipping cart saving correctly for Guest."/> |
| 15 | + <description value="Verify that 'Estimate Shipping and Tax' block sections on shipping cart saving correctly for Guest after switching to another page. And check that the shopping cart is cleared after reset persistent cookie."/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MAGETWO-99025"/> |
| 18 | + <useCaseId value="MAGETWO-98620"/> |
| 19 | + <group value="persistent"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!--Enabled The Persistent Shopping Cart feature --> |
| 23 | + <createData entity="PersistentConfigEnabled" stepKey="enablePersistent"/> |
| 24 | + <createData entity="PersistentLogoutClearDisable" stepKey="persistentLogoutClearDisable"/> |
| 25 | + <!--Create simple product--> |
| 26 | + <createData entity="SimpleProduct2" stepKey="createProduct"> |
| 27 | + <field key="price">150</field> |
| 28 | + </createData> |
| 29 | + <!--Create customer--> |
| 30 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"> |
| 31 | + <field key="firstname">John1</field> |
| 32 | + <field key="lastname">Doe1</field> |
| 33 | + </createData> |
| 34 | + </before> |
| 35 | + <after> |
| 36 | + <!--Revert persistent configuration to default--> |
| 37 | + <createData entity="PersistentConfigDefault" stepKey="setDefaultPersistentState"/> |
| 38 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 39 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 40 | + <actionGroup ref="logout" stepKey="logout"/> |
| 41 | + </after> |
| 42 | + <!--Step 1: Login as a Customer with remember me checked--> |
| 43 | + <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeChecked" stepKey="loginToStorefrontAccountWithRememberMeChecked"> |
| 44 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 45 | + </actionGroup> |
| 46 | + <!--Step 2: Open the Product Page and add the product to shopping cart--> |
| 47 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPageAsLoggedUser"/> |
| 48 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCartAsLoggedUser"> |
| 49 | + <argument name="productName" value="$$createProduct.name$$"/> |
| 50 | + </actionGroup> |
| 51 | + <!--Step 3: Log out, reset persistent cookie and go to homepage--> |
| 52 | + <amOnPage url="{{StorefrontCustomerSignOutPage.url}}" stepKey="signOut"/> |
| 53 | + <waitForLoadingMaskToDisappear stepKey="waitSignOutPage"/> |
| 54 | + <resetCookie userInput="persistent_shopping_cart" stepKey="resetPersistentCookie"/> |
| 55 | + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnHomePageAfterResetPersistentCookie"/> |
| 56 | + <waitForPageLoad stepKey="waitHomePageLoadAfterResetCookie"/> |
| 57 | + <!--Check that the minicart is empty--> |
| 58 | + <actionGroup ref="assertMiniCartEmpty" after="waitHomePageLoadAfterResetCookie" stepKey="seeMinicartEmpty"/> |
| 59 | + <!--Step 4: Add the product to shopping cart and open cart--> |
| 60 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPageAsGuestUser"/> |
| 61 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCartAsGuestUser"> |
| 62 | + <argument name="productName" value="$$createProduct.name$$"/> |
| 63 | + </actionGroup> |
| 64 | + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartBeforeChangeShippingAndTaxSection"/> |
| 65 | + <!--Step 5: Open Estimate Shipping and Tax block and fill the sections--> |
| 66 | + <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingAndTax" /> |
| 67 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> |
| 68 | + <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="selectUSCountry"/> |
| 69 | + <selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_CA.state}}" stepKey="selectCaliforniaRegion"/> |
| 70 | + <fillField selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{US_Address_CA.postcode}}" stepKey="inputPostCode"/> |
| 71 | + <!--Step 6: Go to Homepage--> |
| 72 | + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePageAfterChangingShippingAndTaxSection"/> |
| 73 | + <!--Step 7: Go to shopping cart and check "Estimate Shipping and Tax" fields values are saved--> |
| 74 | + <actionGroup ref="clickViewAndEditCartFromMiniCart" after="goToHomePageAfterChangingShippingAndTaxSection" stepKey="goToShoppingCartAfterChangingShippingAndTaxSection"/> |
| 75 | + <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingAndTaxAfterChanging" /> |
| 76 | + <seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCustomerCountry" /> |
| 77 | + <seeOptionIsSelected selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_CA.state}}" stepKey="checkCustomerRegion" /> |
| 78 | + <grabValueFrom selector="{{CheckoutCartSummarySection.postcode}}" stepKey="grabTextPostCode"/> |
| 79 | + <assertEquals message="Customer postcode is invalid" stepKey="checkCustomerPostcode"> |
| 80 | + <expectedResult type="string">{{US_Address_CA.postcode}}</expectedResult> |
| 81 | + <actualResult type="variable">grabTextPostCode</actualResult> |
| 82 | + </assertEquals> |
| 83 | + </test> |
| 84 | +</tests> |
0 commit comments