|
| 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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> |
| 11 | + <test name="StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle"> |
| 12 | + <annotations> |
| 13 | + <group value="Catalog"/> |
| 14 | + <title value="Admin should be able to see the full title of the selected custom option value in the order"/> |
| 15 | + <description value="Admin should be able to see the full title of the selected custom option value in the order"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="MAGETWO-93340"/> |
| 18 | + <group value="product"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!--Create Simple Product with Custom Options--> |
| 22 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 23 | + <createData entity="_defaultProduct" stepKey="createProduct"> |
| 24 | + <requiredEntity createDataKey="createCategory"/> |
| 25 | + <field key="price">17</field> |
| 26 | + </createData> |
| 27 | + <updateData createDataKey="createProduct" entity="ProductWithOptions2" stepKey="updateProductWithOptions"/> |
| 28 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 32 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 33 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 34 | + </after> |
| 35 | + <!-- Login Customer Storefront --> |
| 36 | + <actionGroup ref="CustomerLoginOnStorefront" stepKey="customerLogin"> |
| 37 | + <argument name="customer" value="$$createCustomer$$" /> |
| 38 | + </actionGroup> |
| 39 | + <!-- Checking the correctness of displayed prices for user parameters --> |
| 40 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnProductPage"/> |
| 41 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 42 | + <seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptionsDropDown(ProductOptionDropDownWithLongValuesTitle.title, ProductOptionValueDropdownLongTitle1.price)}}" stepKey="checkDropDownProductOption"/> |
| 43 | + <!-- Adding items to the checkout --> |
| 44 | + <selectOption userInput="{{ProductOptionValueDropdownLongTitle1.price}}" selector="{{StorefrontProductInfoMainSection.productOptionSelect(ProductOptionDropDownWithLongValuesTitle.title)}}" stepKey="seeProductOptionDropDown"/> |
| 45 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="finalProductPrice"/> |
| 46 | + <actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> |
| 47 | + <argument name="productName" value="$$createProduct.name$$"/> |
| 48 | + </actionGroup> |
| 49 | + <!-- Checking the correctness of displayed custom options for user parameters on checkout --> |
| 50 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart" /> |
| 51 | + <conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{CheckoutPaymentSection.cartItemsArea}}" visible="true" stepKey="exposeMiniCart"/> |
| 52 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForCartItem"/> |
| 53 | + <waitForElement selector="{{CheckoutPaymentSection.cartItemsAreaActive}}" time="30" stepKey="waitForCartItemsAreaActive"/> |
| 54 | + <see selector="{{CheckoutPaymentSection.cartItems}}" userInput="$$createProduct.name$$" stepKey="seeProductInCart"/> |
| 55 | + <conditionalClick selector="{{CheckoutPaymentSection.productOptionsByProductItemName($$createProduct.name$$)}}" dependentSelector="{{CheckoutPaymentSection.productOptionsActiveByProductItemName($$createProduct.name$$)}}" visible="false" stepKey="exposeProductOptions"/> |
| 56 | + <see selector="{{CheckoutPaymentSection.productOptionsActiveByProductItemName($$createProduct.name$$)}}" userInput="{{ProductOptionValueDropdownLongTitle1.title}}" stepKey="seeProductOptionValueDropdown1Input1"/> |
| 57 | + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> |
| 58 | + <!-- Place Order --> |
| 59 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPayment"/> |
| 60 | + <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> |
| 61 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> |
| 62 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 63 | + <!-- Login to Admin and open Order --> |
| 64 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> |
| 65 | + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> |
| 66 | + <waitForPageLoad stepKey="waitForPageLoad1"/> |
| 67 | + <fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="fillOrderNum"/> |
| 68 | + <click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearchOrderNum"/> |
| 69 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnSearch"/> |
| 70 | + <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> |
| 71 | + <!-- Checking the correctness of displayed custom options for user parameters on Order --> |
| 72 | + <dontSee selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionValueDropdownLongTitle1.title}}" stepKey="dontSeeAdminOrderProductOptionValueDropdown1"/> |
| 73 | + <grabTextFrom selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd" stepKey="productOptionValueText"/> |
| 74 | + <assertEquals stepKey="checkProductOptionValue"> |
| 75 | + <actualResult type="variable">productOptionValueText</actualResult> |
| 76 | + <expectedResult type="string">Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj111 ...</expectedResult> |
| 77 | + </assertEquals> |
| 78 | + <moveMouseOver selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd" stepKey="hoverProduct"/> |
| 79 | + <grabTextFrom selector="{{AdminOrderItemsOrderedSection.productNameOptions}} span:nth-child(2)" stepKey="productOptionValueTruncatedText"/> |
| 80 | + <assertEquals stepKey="checkProductOptionTruncatedValue"> |
| 81 | + <actualResult type="variable">productOptionValueTruncatedText</actualResult> |
| 82 | + <expectedResult type="string">11Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111</expectedResult> |
| 83 | + </assertEquals> |
| 84 | + <seeElement selector="{{AdminOrderItemsOrderedSection.productNameOptions}} span:nth-child(2)" stepKey="seeAdminOrderProductOptionValueDropdown1"/> |
| 85 | + </test> |
| 86 | +</tests> |
0 commit comments