Skip to content

Commit dd5a687

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-70803' into EPAM-PR-73
2 parents 24959dc + d4bb503 commit dd5a687

File tree

6 files changed

+207
-5
lines changed

6 files changed

+207
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
141141
const COL_PRODUCT_WEBSITES = '_product_websites';
142142

143143
/**
144-
* Media gallery attribute code.
144+
* Attribute code for media gallery.
145145
*/
146146
const MEDIA_GALLERY_ATTRIBUTE_CODE = 'media_gallery';
147147

@@ -151,12 +151,12 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
151151
const COL_MEDIA_IMAGE = '_media_image';
152152

153153
/**
154-
* Inventory use config.
154+
* Inventory use config label.
155155
*/
156156
const INVENTORY_USE_CONFIG = 'Use Config';
157157

158158
/**
159-
* Inventory use config prefix.
159+
* Prefix for inventory use config.
160160
*/
161161
const INVENTORY_USE_CONFIG_PREFIX = 'use_config_';
162162

@@ -1886,6 +1886,7 @@ protected function _saveProducts()
18861886

18871887
return $this;
18881888
}
1889+
//phpcs:enable Generic.Metrics.NestingLevel
18891890

18901891
/**
18911892
* Prepare array with image states (visible or hidden from product page)
@@ -2736,8 +2737,6 @@ protected function _saveValidatedBunches()
27362737
try {
27372738
$rowData = $source->current();
27382739
} catch (\InvalidArgumentException $e) {
2739-
$this->addRowError($e->getMessage(), $this->_processedRowsCount);
2740-
$this->_processedRowsCount++;
27412740
$source->next();
27422741
continue;
27432742
}

app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminImportProductsActionGroup.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,11 @@
4646
<see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{validationNoticeMessage}}" after="waitForValidationNoticeMessage" stepKey="seeValidationNoticeMessage"/>
4747
<see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{validationMessage}}" after="seeValidationNoticeMessage" stepKey="seeValidationMessage"/>
4848
</actionGroup>
49+
<actionGroup name="checkDataForImportProductActionGroup" extends="AdminImportProductsActionGroup">
50+
<remove keyForRemoval="clickImportButton"/>
51+
<remove keyForRemoval="AdminImportMainSectionLoad2"/>
52+
<remove keyForRemoval="assertSuccessMessage"/>
53+
<remove keyForRemoval="AdminMessagesSection"/>
54+
<remove keyForRemoval="seeImportMessage"/>
55+
</actionGroup>
4956
</actionGroups>

app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<element name="importBehavior" type="select" selector="#basic_behavior"/>
1414
<element name="selectFileToImport" type="input" selector="#import_file"/>
1515
<element name="importButton" type="button" selector="#import_validation_container button" timeout="30"/>
16+
<element name="messageSuccess" type="text" selector=".messages div.message-success"/>
17+
<element name="messageError" type="text" selector=".messages div.message-error"/>
1618
<element name="validationStrategy" type="select" selector="#basic_behaviorvalidation_strategy"/>
1719
<element name="allowedErrorsCount" type="input" selector="#basic_behavior_allowed_error_count"/>
1820
</section>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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="AdminProductImportCSVFileCorrectDifferentFilesTest">
12+
<annotations>
13+
<description value="Product import from CSV file correct from different files."/>
14+
<features value="Import/Export"/>
15+
<title value="Product import from CSV file correct from different files."/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MC-17104"/>
18+
<useCaseId value="MAGETWO-70803"/>
19+
<group value="importExport"/>
20+
</annotations>
21+
<before>
22+
<!--Login as Admin-->
23+
<comment userInput="Login as Admin" stepKey="commentLogin"/>
24+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
25+
</before>
26+
<after>
27+
<!--Logout from Admin-->
28+
<comment userInput="Logout from Admin" stepKey="commentLogout"/>
29+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
30+
</after>
31+
<!--Check data products with add/update behavior-->
32+
<comment userInput="Check data products with add/update behavior" stepKey="commentCheckData"/>
33+
<actionGroup ref="checkDataForImportProductActionGroup" stepKey="adminImportProducts">
34+
<argument name="behavior" value="Add/Update"/>
35+
<argument name="importFile" value="BB-ProductsWorking.csv"/>
36+
<argument name="importMessage" value="Checked rows: 28, checked entities: 28, invalid rows: 0, total errors: 0"/>
37+
</actionGroup>
38+
<see selector="{{AdminImportMainSection.messageSuccess}}" userInput='File is valid! To start import process press "Import" button' stepKey="seeSuccessMessage"/>
39+
<actionGroup ref="checkDataForImportProductActionGroup" stepKey="adminImportProducts1">
40+
<argument name="behavior" value="Add/Update"/>
41+
<argument name="importFile" value="BB-Products.csv"/>
42+
<argument name="importMessage" value="Checked rows: 117, checked entities: 115, invalid rows: 2, total errors: 2"/>
43+
<argument name="checkMessage" value='Curly quotes used instead of straight quotes in row(s): 84, 85'/>
44+
</actionGroup>
45+
<see selector="{{AdminImportMainSection.messageError}}" userInput='Curly quotes used instead of straight quotes in row(s): 84, 85' stepKey="seeErrorMessage"/>
46+
</test>
47+
</tests>

0 commit comments

Comments
 (0)