|
| 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="StorefrontCheckoutWithWithVirtualProductTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Multishipping"/> |
| 14 | + <stories value="Multiple Shipping"/> |
| 15 | + <title value="Check error when cart contains virtual product"/> |
| 16 | + <description value="Check error when cart contains only virtual product"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <group value="Multishipment"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 22 | + <createData entity="SimpleProduct" stepKey="firstProduct"> |
| 23 | + <requiredEntity createDataKey="createCategory"/> |
| 24 | + </createData> |
| 25 | + <createData entity="VirtualProduct" stepKey="virtualProduct"> |
| 26 | + <requiredEntity createDataKey="createCategory"/> |
| 27 | + </createData> |
| 28 | + <createData entity="Customer_US_UK_DE" stepKey="createCustomerWithMultipleAddresses"/> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 32 | + <deleteData createDataKey="firstProduct" stepKey="deleteFirstProduct"/> |
| 33 | + <deleteData createDataKey="virtualProduct" stepKey="deleteVirtualProduct"/> |
| 34 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 35 | + <deleteData createDataKey="createCustomerWithMultipleAddresses" stepKey="deleteCustomer"/> |
| 36 | + </after> |
| 37 | + <!-- Login to the Storefront as created customer --> |
| 38 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> |
| 39 | + <argument name="Customer" value="$$createCustomerWithMultipleAddresses$$"/> |
| 40 | + </actionGroup> |
| 41 | + <!-- Open the simple product page --> |
| 42 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToFirstProductPage"> |
| 43 | + <argument name="productUrl" value="$$firstProduct.custom_attributes[url_key]$$"/> |
| 44 | + </actionGroup> |
| 45 | + <!-- Add the simple product to the Shopping Cart --> |
| 46 | + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addFirstProductToCart"> |
| 47 | + <argument name="productName" value="$$firstProduct.name$$"/> |
| 48 | + <argument name="productQty" value="1"/> |
| 49 | + </actionGroup> |
| 50 | + <!-- Open the virtual product page --> |
| 51 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToVirtualProductPage"> |
| 52 | + <argument name="productUrl" value="$$virtualProduct.custom_attributes[url_key]$$"/> |
| 53 | + </actionGroup> |
| 54 | + <!-- Add the virtual product to the Shopping Cart --> |
| 55 | + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addVirtualProductToCart"> |
| 56 | + <argument name="productName" value="$$virtualProduct.name$$"/> |
| 57 | + <argument name="productQty" value="1"/> |
| 58 | + </actionGroup> |
| 59 | + <!-- Go to Cart --> |
| 60 | + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> |
| 61 | + <!-- Check Out with Multiple Addresses --> |
| 62 | + <actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/> |
| 63 | + <!-- Remove simple product from cart --> |
| 64 | + <actionGroup ref="StorefrontRemoveProductOnCheckoutActionGroup" stepKey="removeFirstProductFromCart"/> |
| 65 | + <!-- Assert error message on checkout --> |
| 66 | + <actionGroup ref="StorefrontAssertCheckoutErrorMessageActionGroup" stepKey="assertErrorMessage"> |
| 67 | + <argument name="message" value="The current cart does not match multi shipping criteria, please review or contact the store administrator"/> |
| 68 | + </actionGroup> |
| 69 | + </test> |
| 70 | +</tests> |
0 commit comments