Skip to content

Commit ed8b676

Browse files
authored
Merge pull request #3135 from magento-epam/EPAM-PR-6
[epam] MAGETWO-91501: Invoice and Shipping PDF does not show Size 0 for child product
2 parents 1a752a5 + b0b7f04 commit ed8b676

File tree

17 files changed

+430
-8
lines changed

17 files changed

+430
-8
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
12+
<!--Create New Template -->
13+
<actionGroup name="CreateNewTemplate">
14+
<!--Click "Add New Template" button-->
15+
<click stepKey="clickAddNewTemplateButton" selector="{{EmailTemplatesSection.addNewTemplateButton}}"/>
16+
<waitForPageLoad stepKey="waitForNewEmailTemplatesPageLoaded"/>
17+
<!--Select value for "Template" drop-down menu in "Load default template" tab-->
18+
<selectOption selector="{{EmailTemplatesSection.templateDropDown}}" stepKey="selectValueFromTemplateDropDown" userInput="Registry Update"/>
19+
20+
<!--Fill in required fields in "Template Information" tab and click "Save Template" button-->
21+
<click stepKey="clickLoadTemplateButton" selector="{{EmailTemplatesSection.loadTemplateButton}}" after="selectValueFromTemplateDropDown"/>
22+
<fillField stepKey="fillTemplateNameField" selector="{{EmailTemplatesSection.templateNameField}}" userInput="{{EmailTemplate.templateName}}" after="clickLoadTemplateButton"/>
23+
<waitForLoadingMaskToDisappear stepKey="wait1"/>
24+
<click stepKey="clickSaveTemplateButton" selector="{{EmailTemplatesSection.saveTemplateButton}}"/>
25+
<waitForPageLoad stepKey="waitForNewTemplateCreated"/>
26+
</actionGroup>
27+
28+
<!--Delete created Template-->
29+
<actionGroup name="DeleteCreatedTemplate">
30+
<switchToPreviousTab stepKey="switchToPreviousTab"/>
31+
<seeInCurrentUrl stepKey="seeCreatedTemplateUrl" url="email_template/edit/id"/>
32+
<click stepKey="clickDeleteTemplateButton" selector="{{EmailTemplatesSection.deleteTemplateButton}}"/>
33+
<acceptPopup stepKey="acceptDeletingTemplatePopUp"/>
34+
<see stepKey="SeeSuccessfulMessage" userInput="You deleted the email template."/>
35+
<click stepKey="clickResetFilterButton" selector="{{EmailTemplatesSection.resetFilterButton}}"/>
36+
<waitForElementNotVisible selector="{{MarketingEmailTemplateSection.clearSearchTemplate(EmailTemplate.templateName)}}" stepKey="waitForSearchFieldCleared"/>
37+
</actionGroup>
38+
39+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="EmailTemplate" type="template">
12+
<data key="templateName" unique="suffix">Template</data>
13+
</entity>
14+
</entities>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:/Page/etc/PageObject.xsd">
11+
<page name="AdminEmailTemplatePage" url="/admin/email_template/" area="admin" module="Email">
12+
<section name="AdminEmailTemplatePageActionSection"/>
13+
</page>
14+
</pages>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
12+
<section name="MarketingEmailTemplateSection">
13+
<element name="searchTemplateField" type="input" selector="#systemEmailTemplateGrid_filter_code"/>
14+
<element name="searchButton" type="button" selector="//*[@title='Search' and @class='action-default scalable action-secondary']"/>
15+
<element name="createdTemplate" type="button" selector="//*[normalize-space() ='{{arg}}']" parameterized="true"/>
16+
<element name="clearSearchTemplate" type="input" selector="//*[@id='systemEmailTemplateGrid_filter_code' and @value='{{arg2}}']" parameterized="true"/>
17+
</section>
18+
19+
<section name="EmailTemplatesSection">
20+
<element name="addNewTemplateButton" type="button" selector="#add"/>
21+
<element name="templateDropDown" type="select" selector="#template_select"/>
22+
<element name="loadTemplateButton" type="button" selector="#load"/>
23+
<element name="templateNameField" type="input" selector="#template_code"/>
24+
<element name="saveTemplateButton" type="button" selector="#save"/>
25+
<element name="previewTemplateButton" type="button" selector="#preview"/>
26+
<element name="deleteTemplateButton" type="button" selector="#delete"/>
27+
<element name="resetFilterButton" type="button" selector="//span[contains(text(),'Reset Filter')]"/>
28+
</section>
29+
30+
</sections>

app/code/Magento/Email/view/adminhtml/templates/template/edit.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ require([
150150
} else {
151151
$('preview_type').value = <?= (int) $block->getTemplateType() ?>;
152152
}
153-
if (typeof tinyMCE == 'undefined' || !tinyMCE.getInstanceById('template_text')) {
153+
if (typeof tinyMCE == 'undefined' || !tinyMCE.get('template_text')) {
154154
$('preview_text').value = $('template_text').value;
155155
} else {
156-
$('preview_text').value = tinyMCE.getInstanceById('template_text').getHTML();
156+
$('preview_text').value = tinyMCE.get('template_text').getHTML();
157157
}
158158

159159
if ($('template_styles') != undefined) {

app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function draw()
128128
];
129129

130130
// Checking whether option value is not null
131-
if ($option['value']!= null) {
131+
if ($option['value'] !== null) {
132132
if (isset($option['print_value'])) {
133133
$printValue = $option['print_value'];
134134
} else {

app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function draw()
8989
];
9090

9191
// draw options value
92-
if ($option['value']!= null) {
92+
if ($option['value'] !== null) {
9393
$printValue = isset(
9494
$option['print_value']
9595
) ? $option['print_value'] : $this->filterManager->stripTags(

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,28 @@
115115
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
116116
</actionGroup>
117117

118+
<!--Add configurable product to order -->
119+
<actionGroup name="addConfigurableProductToOrderFromAdmin" extends="addConfigurableProductToOrder">
120+
<waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/>
121+
<selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}"
122+
userInput="{{option.label}}" stepKey="selectionConfigurableOption"/>
123+
</actionGroup>
124+
125+
<actionGroup name="configureOrderedConfigurableProduct">
126+
<arguments>
127+
<argument name="attribute"/>
128+
<argument name="option"/>
129+
<argument name="quantity" type="string"/>
130+
</arguments>
131+
<click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/>
132+
<waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/>
133+
<wait time="2" stepKey="waitForOptionsToLoad"/>
134+
<selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}"
135+
userInput="{{option.label}}" stepKey="selectionConfigurableOption"/>
136+
<fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/>
137+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/>
138+
</actionGroup>
139+
118140
<!--Add bundle product to order -->
119141
<actionGroup name="addBundleProductToOrder">
120142
<arguments>
@@ -200,7 +222,6 @@
200222
<waitForElementVisible selector="{{AdminOrderFormPaymentSection.flatRateOption}}" stepKey="waitForShippingOptions"/>
201223
<selectOption selector="{{AdminOrderFormPaymentSection.flatRateOption}}" userInput="flatrate_flatrate" stepKey="checkFlatRate"/>
202224
</actionGroup>
203-
204225
<!--Check that customer information is correct in order-->
205226
<actionGroup name="verifyBasicOrderInformation">
206227
<arguments>
@@ -222,6 +243,14 @@
222243
<see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/>
223244
</actionGroup>
224245

246+
<!--Verify order information-->
247+
<actionGroup name="verifyCreatedOrderInformation">
248+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/>
249+
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/>
250+
<grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/>
251+
<assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/>
252+
</actionGroup>
253+
225254
<!--Check for product in order items list-->
226255
<actionGroup name="seeProductInItemsOrdered">
227256
<arguments>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
<element name="rowCheck" type="checkbox" selector="#sales_order_create_search_grid_table > tbody tr:nth-of-type({{row}}) td.col-select [type=checkbox]" parameterized="true"/>
2828
<element name="rowQty" type="input" selector="#sales_order_create_search_grid_table > tbody tr:nth-of-type({{row}}) td.col-qty [name='qty']" parameterized="true"/>
2929
<element name="addSelected" type="button" selector="#order-search .admin__page-section-title .actions button.action-add" timeout="30"/>
30+
<element name="configure" type="button" selector=".product-configure-block button.action-default.scalable" timeout="30"/>
3031
</section>
3132
</sections>
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
<test name="AdminSubmitConfigurableProductOrderTest">
11+
<annotations>
12+
<title value="Create Order in Admin and update product configuration"/>
13+
<stories value="MAGETWO-59632: Create Sales > Order from admin add configurable product and change options click OK does not update Items Ordered List"/>
14+
<description value="Create Order in Admin and update product configuration"/>
15+
<features value="Sales"/>
16+
<severity value="AVERAGE"/>
17+
<testCaseId value="MAGETWO-59633"/>
18+
<group value="Sales"/>
19+
</annotations>
20+
21+
<before>
22+
<!--Set default flat rate shipping method settings-->
23+
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
24+
25+
<!--Create simple customer-->
26+
<createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/>
27+
28+
<!-- Create the category -->
29+
<createData entity="ApiCategory" stepKey="createCategory"/>
30+
31+
<!-- Create the configurable product and add it to the category -->
32+
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
33+
<requiredEntity createDataKey="createCategory"/>
34+
</createData>
35+
36+
<!-- Create an attribute with two options to be used in the first child product -->
37+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
38+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
39+
<requiredEntity createDataKey="createConfigProductAttribute"/>
40+
</createData>
41+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
42+
<requiredEntity createDataKey="createConfigProductAttribute"/>
43+
</createData>
44+
45+
<!-- Add the attribute we just created to default attribute set -->
46+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
47+
<requiredEntity createDataKey="createConfigProductAttribute"/>
48+
</createData>
49+
50+
<!-- Get the option of the attribute we created -->
51+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
52+
<requiredEntity createDataKey="createConfigProductAttribute"/>
53+
</getData>
54+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
55+
<requiredEntity createDataKey="createConfigProductAttribute"/>
56+
</getData>
57+
58+
<!-- Create a simple product and give it the attribute with option -->
59+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
60+
<requiredEntity createDataKey="createConfigProductAttribute"/>
61+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
62+
</createData>
63+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
64+
<requiredEntity createDataKey="createConfigProductAttribute"/>
65+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
66+
</createData>
67+
68+
<!-- Create the configurable product -->
69+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
70+
<requiredEntity createDataKey="createConfigProduct"/>
71+
<requiredEntity createDataKey="createConfigProductAttribute"/>
72+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
73+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
74+
</createData>
75+
76+
<!-- Add simple product to the configurable product -->
77+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
78+
<requiredEntity createDataKey="createConfigProduct"/>
79+
<requiredEntity createDataKey="createConfigChildProduct1"/>
80+
</createData>
81+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
82+
<requiredEntity createDataKey="createConfigProduct"/>
83+
<requiredEntity createDataKey="createConfigChildProduct2"/>
84+
</createData>
85+
86+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
87+
</before>
88+
89+
<!--Create new customer order-->
90+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer">
91+
<argument name="customer" value="$$simpleCustomer$$"/>
92+
</actionGroup>
93+
94+
<!--Add configurable product to order-->
95+
<actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder">
96+
<argument name="product" value="$$createConfigProduct$$"/>
97+
<argument name="attribute" value="$$createConfigProductAttribute$$"/>
98+
<argument name="option" value="$$getConfigAttributeOption1$$"/>
99+
</actionGroup>
100+
101+
<!--Configure ordered configurable product-->
102+
<actionGroup ref="configureOrderedConfigurableProduct" stepKey="configureOrderedConfigurableProduct">
103+
<argument name="attribute" value="$$createConfigProductAttribute$$"/>
104+
<argument name="option" value="$$getConfigAttributeOption2$$"/>
105+
<argument name="quantity" value="2"/>
106+
</actionGroup>
107+
108+
<!--Select FlatRate shipping method-->
109+
<actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/>
110+
111+
<!--Submit order-->
112+
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/>
113+
114+
<!--Verify order information-->
115+
<actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/>
116+
117+
<after>
118+
<actionGroup ref="logout" stepKey="logout"/>
119+
120+
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/>
121+
122+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
123+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
124+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
125+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
126+
<deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/>
127+
</after>
128+
</test>
129+
</tests>

app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ define([
921921
qtyElement.value = confirmedCurrentQty.value;
922922
}
923923
this.productConfigureAddFields['item['+itemId+'][configured]'] = 1;
924+
this.itemsUpdate();
924925

925926
}.bind(this));
926927
productConfigure.setShowWindowCallback(listType, function() {

app/code/Magento/Ui/Model/Export/MetadataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(
6060
Filter $filter,
6161
TimezoneInterface $localeDate,
6262
ResolverInterface $localeResolver,
63-
$dateFormat = 'M j, Y H:i:s A',
63+
$dateFormat = 'M j, Y h:i:s A',
6464
array $data = []
6565
) {
6666
$this->filter = $filter;

0 commit comments

Comments
 (0)