Skip to content

Commit 6332436

Browse files
committed
Merge branch '2.3-develop' into MC-1364
2 parents f3f1a45 + 08d13a1 commit 6332436

File tree

44 files changed

+1357
-565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1357
-565
lines changed

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@
280280
<requiredEntity type="product_option">ProductOptionDateTime</requiredEntity>
281281
<requiredEntity type="product_option">ProductOptionTime</requiredEntity>
282282
</entity>
283+
<entity name="productWithOptions2" type="product">
284+
<var key="sku" entityType="product" entityKey="sku" />
285+
<requiredEntity type="product_option">ProductOptionDropDownWithLongValuesTitle</requiredEntity>
286+
</entity>
283287
<entity name="ApiVirtualProductWithDescription" type="product">
284288
<data key="sku" unique="suffix">api-virtual-product</data>
285289
<data key="type_id">virtual</data>

app/code/Magento/Catalog/Test/Mftf/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>

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

app/code/Magento/CatalogImportExport/Model/Import/Uploader.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,25 @@ public function move($fileName, $renameFileOff = false)
170170
}
171171
}
172172

173+
if ($this->getTmpDir()) {
174+
$filePath = $this->getTmpDir() . '/';
175+
} else {
176+
$filePath = '';
177+
}
173178
$fileName = preg_replace('/[^a-z0-9\._-]+/i', '', $fileName);
179+
$filePath = $this->_directory->getRelativePath($filePath . $fileName);
174180
$this->_directory->writeFile(
175-
$this->_directory->getRelativePath($this->getTmpDir() . '/' . $fileName),
181+
$filePath,
176182
$read->readAll()
177183
);
178184
}
179185

180-
$filePath = $this->_directory->getRelativePath($this->getTmpDir() . '/' . $fileName);
186+
if ($this->getTmpDir()) {
187+
$filePath = $this->getTmpDir() . '/';
188+
} else {
189+
$filePath = '';
190+
}
191+
$filePath = $this->_directory->getRelativePath($filePath . $fileName);
181192
$this->_setUploadFile($filePath);
182193
$destDir = $this->_directory->getAbsolutePath($this->getDestDir());
183194
$result = $this->save($destDir);

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/UploaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected function setUp()
103103
public function testMoveFileUrl($fileUrl, $expectedHost, $expectedFileName)
104104
{
105105
$destDir = 'var/dest/dir';
106-
$expectedRelativeFilePath = $this->uploader->getTmpDir() . '/' . $expectedFileName;
106+
$expectedRelativeFilePath = $expectedFileName;
107107
$this->directoryMock->expects($this->once())->method('isWritable')->with($destDir)->willReturn(true);
108108
$this->directoryMock->expects($this->any())->method('getRelativePath')->with($expectedRelativeFilePath);
109109
$this->directoryMock->expects($this->once())->method('getAbsolutePath')->with($destDir)
@@ -139,7 +139,7 @@ public function testMoveFileName()
139139
{
140140
$destDir = 'var/dest/dir';
141141
$fileName = 'test_uploader_file';
142-
$expectedRelativeFilePath = $this->uploader->getTmpDir() . '/' . $fileName;
142+
$expectedRelativeFilePath = $fileName;
143143
$this->directoryMock->expects($this->once())->method('isWritable')->with($destDir)->willReturn(true);
144144
$this->directoryMock->expects($this->any())->method('getRelativePath')->with($expectedRelativeFilePath);
145145
$this->directoryMock->expects($this->once())->method('getAbsolutePath')->with($destDir)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
<actionGroups 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/actionGroupSchema.xsd">
10+
<actionGroup name="CreateNewPageWithAllValues">
11+
<arguments>
12+
<argument name="PageTitle" type="string"/>
13+
<argument name="ContentHeading" type="string"/>
14+
<argument name="URLKey" type="string"/>
15+
<argument name="selectStoreViewOpt" type="string"/>
16+
<argument name="selectHierarchyOpt" type="string"/>
17+
</arguments>
18+
<amOnPage url="{{CmsNewPagePage.url}}" stepKey="amOnCMSNewPage"/>
19+
<waitForPageLoad stepKey="waitForPageLoad1"/>
20+
<fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{PageTitle}}" stepKey="fillFieldTitle"/>
21+
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/>
22+
<fillField selector="{{CmsNewPagePageContentSection.contentHeading}}" userInput="{{ContentHeading}}" stepKey="fillFieldContentHeading"/>
23+
<click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimization"/>
24+
<fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{URLKey}}" stepKey="fillFieldURLKey"/>
25+
<click selector="{{CmsNewPagePiwSection.header}}" stepKey="clickPageInWebsites"/>
26+
<waitForElementVisible selector="{{CmsNewPagePiwSection.selectStoreView(selectStoreViewOpt)}}" stepKey="waitForStoreGridReload"/>
27+
<clickWithLeftButton selector="{{CmsNewPagePiwSection.selectStoreView(selectStoreViewOpt)}}" stepKey="clickStoreView2"/>
28+
<click selector="{{CmsNewPageHierarchySection.header}}" stepKey="clickHierarchy"/>
29+
<click selector="{{CmsNewPageHierarchySection.selectHierarchy(selectHierarchyOpt)}}" stepKey="clickPageCheckBoxes"/>
30+
</actionGroup>
31+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<actionGroups 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/actionGroupSchema.xsd">
10+
<actionGroup name="DeletePageByUrlKeyActionGroup">
11+
<arguments>
12+
<argument name="UrlKey" type="string"/>
13+
</arguments>
14+
<amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnCMSNewPage"/>
15+
<waitForPageLoad stepKey="waitForPageLoad1"/>
16+
<click selector="{{CmsPagesPageActionsSection.select(UrlKey)}}" stepKey="clickSelect"/>
17+
<click selector="{{CmsPagesPageActionsSection.delete(UrlKey)}}" stepKey="clickDelete"/>
18+
<waitForElementVisible selector="{{CmsPagesPageActionsSection.deleteConfirm}}" stepKey="waitForOkButtonToBeVisible"/>
19+
<click selector="{{CmsPagesPageActionsSection.deleteConfirm}}" stepKey="clickOkButton"/>
20+
<waitForPageLoad stepKey="waitForPageLoad3"/>
21+
<see userInput="The page has been deleted." stepKey="seeSuccessMessage"/>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="CmsNewPageHierarchySection">
12+
<element name="header" type="button" selector="div[data-index=hierarchy]" timeout="30"/>
13+
<element name="selectHierarchy" type="button" selector="//a/span[contains(text(),'{{var1}}')]" parameterized="true" timeout="30"/>
14+
</section>
15+
</sections>
16+
17+
18+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="CmsNewPagePiwSection">
12+
<element name="header" type="button" selector="div[data-index=websites]" timeout="30"/>
13+
<element name="selectStoreView" type="select" selector="//option[contains(text(),'{{var1}}')]" parameterized="true"/>
14+
</section>
15+
</sections>

0 commit comments

Comments
 (0)