Skip to content

Commit d4b3346

Browse files
committed
MAGETWO-91528: Customizable options truncated when displaying ordered product in admin
1 parent 6065ac0 commit d4b3346

File tree

4 files changed

+130
-2
lines changed

4 files changed

+130
-2
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@
254254
<requiredEntity type="product_option">ProductOptionDateTime</requiredEntity>
255255
<requiredEntity type="product_option">ProductOptionTime</requiredEntity>
256256
</entity>
257+
<entity name="productWithOptions2" type="product">
258+
<var key="sku" entityType="product" entityKey="sku" />
259+
<requiredEntity type="product_option">ProductOptionDropDownWithLongValuesTitle</requiredEntity>
260+
</entity>
257261
<entity name="ApiVirtualProductWithDescription" type="product">
258262
<data key="sku" unique="suffix">api-virtual-product</data>
259263
<data key="type_id">virtual</data>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductOptionData.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@
5959
<requiredEntity type="product_option_value">ProductOptionValueDropdown1</requiredEntity>
6060
<requiredEntity type="product_option_value">ProductOptionValueDropdown2</requiredEntity>
6161
</entity>
62+
<entity name="ProductOptionDropDownWithLongValuesTitle" type="product_option">
63+
<var key="product_sku" entityType="product" entityKey="sku" />
64+
<data key="title">OptionDropDownWithLongTitles</data>
65+
<data key="type">drop_down</data>
66+
<data key="sort_order">4</data>
67+
<data key="is_require">true</data>
68+
<requiredEntity type="product_option_value">ProductOptionValueDropdownLongTitle1</requiredEntity>
69+
<requiredEntity type="product_option_value">ProductOptionValueDropdownLongTitle2</requiredEntity>
70+
</entity>
6271
<entity name="ProductOptionRadiobutton" type="product_option">
6372
<var key="product_sku" entityType="product" entityKey="sku" />
6473
<data key="title">OptionRadioButtons</data>
@@ -112,4 +121,4 @@
112121
<data key="price">0.00</data>
113122
<data key="price_type">percent</data>
114123
</entity>
115-
</entities>
124+
</entities>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductOptionValueData.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,16 @@
5050
<data key="price">2</data>
5151
<data key="price_type">fixed</data>
5252
</entity>
53-
</entities>
53+
<entity name="ProductOptionValueDropdownLongTitle1" type="product_option_value">
54+
<data key="title">Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111</data>
55+
<data key="sort_order">1</data>
56+
<data key="price">10</data>
57+
<data key="price_type">fixed</data>
58+
</entity>
59+
<entity name="ProductOptionValueDropdownLongTitle2" type="product_option_value">
60+
<data key="title">Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj22222Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj22222</data>
61+
<data key="sort_order">2</data>
62+
<data key="price">20</data>
63+
<data key="price_type">percent</data>
64+
</entity>
65+
</entities>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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="../../../../../../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="MC-3043"/>
18+
</annotations>
19+
<before>
20+
<!--Create Simple Product with Custom Options-->
21+
<createData entity="_defaultCategory" stepKey="createCategory"/>
22+
<createData entity="_defaultProduct" stepKey="createProduct">
23+
<requiredEntity createDataKey="createCategory"/>
24+
<field key="price">17</field>
25+
</createData>
26+
<updateData createDataKey="createProduct" entity="productWithOptions2" stepKey="updateProductWithOptions"/>
27+
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+
36+
<!-- Login Customer Storefront -->
37+
38+
<amOnPage url="{{StorefrontCustomerSignInPage.url}}" stepKey="amOnSignInPage"/>
39+
<fillField userInput="$$createCustomer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="fillEmail"/>
40+
<fillField userInput="$$createCustomer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/>
41+
<click selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="clickSignInAccountButton"/>
42+
43+
<!-- Checking the correctness of displayed prices for user parameters -->
44+
45+
<amOnPage url="{{StorefrontHomePage.url}}$$createProduct.custom_attributes[url_key]$$.html" stepKey="amOnProductPage"/>
46+
<seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptionsDropDown(ProductOptionDropDownWithLongValuesTitle.title, ProductOptionValueDropdownLongTitle1.price)}}" stepKey="checkDropDownProductOption"/>
47+
48+
<!-- Adding items to the checkout -->
49+
50+
<selectOption userInput="{{ProductOptionValueDropdownLongTitle1.price}}" selector="{{StorefrontProductInfoMainSection.productOptionSelect(ProductOptionDropDownWithLongValuesTitle.title)}}" stepKey="seeProductOptionDropDown"/>
51+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="finalProductPrice"/>
52+
53+
<actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
54+
<argument name="productName" value="$$createProduct.name$$"/>
55+
</actionGroup>
56+
57+
<!-- Checking the correctness of displayed custom options for user parameters on checkout -->
58+
59+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart" />
60+
61+
<conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{CheckoutPaymentSection.cartItemsArea}}" visible="true" stepKey="exposeMiniCart"/>
62+
63+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForCartItem"/>
64+
<waitForElement selector="{{CheckoutPaymentSection.cartItemsAreaActive}}" time="30" stepKey="waitForCartItemsAreaActive"/>
65+
66+
<see selector="{{CheckoutPaymentSection.cartItems}}" userInput="$$createProduct.name$$" stepKey="seeProductInCart"/>
67+
68+
<conditionalClick selector="{{CheckoutPaymentSection.ProductOptionsByProductItemName($$createProduct.name$$)}}" dependentSelector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($$createProduct.name$$)}}" visible="false" stepKey="exposeProductOptions"/>
69+
70+
<see selector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($$createProduct.name$$)}}" userInput="{{ProductOptionValueDropdownLongTitle1.title}}" stepKey="seeProductOptionValueDropdown1Input1"/>
71+
72+
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
73+
74+
<!-- Place Order -->
75+
76+
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
77+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
78+
79+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
80+
81+
<!-- Login to Admin and open Order -->
82+
83+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
84+
85+
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
86+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnOrdersPage"/>
87+
<fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="fillOrderNum"/>
88+
<click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearchOrderNum"/>
89+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnSearch"/>
90+
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
91+
92+
<!-- Checking the correctness of displayed custom options for user parameters on Order -->
93+
94+
<dontSee selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionValueDropdownLongTitle1.title}}" stepKey="dontSeeAdminOrderProductOptionValueDropdown1"/>
95+
<grabTextFrom selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd" stepKey="productOptionValueText"/>
96+
<assertEquals stepKey="checkProductOptionValue">
97+
<actualResult type="variable">productOptionValueText</actualResult>
98+
<expectedResult type="string">Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj111 ...</expectedResult>
99+
</assertEquals>
100+
<moveMouseOver selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd" stepKey="hoverProduct"/>
101+
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionValueDropdownLongTitle1.title}}" stepKey="seeAdminOrderProductOptionValueDropdown1"/>
102+
</test>
103+
</tests>

0 commit comments

Comments
 (0)