-
Notifications
You must be signed in to change notification settings - Fork 520
/
Copy pathimport_products.feature
198 lines (189 loc) · 9.22 KB
/
import_products.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
@javascript
Feature: Execute a job
In order to use existing product information
As Julia
I need to be able to import products
Background:
Given the "default" catalog configuration
And the following families:
| code |
| Bag |
| Hat |
And the following categories:
| code | label | parent |
| master | Master | |
| leather | Leather | master |
| silk | Silk | master |
| coton | Coton | master |
| travel | Travel | master |
| men | Men | master |
| women | Women | master |
And the following product groups:
| code | label | attributes | type |
| CROSS | Bag Cross | | X_SELL |
And the following attributes:
| code | label | type | metric family | default metric unit |
| name | Name | text | | |
| description | Description | textarea | | |
| prices | Prices | prices | | |
| weight | Weight | metric | Weight | KILOGRAM |
And the following job:
| connector | alias | code | label | type |
| Akeneo CSV Connector | product_import | acme_product_import | Product import for Acme.com | import |
And the following job "acme_product_import" configuration:
| filePath | |
| uploadAllowed | no |
| delimiter | ; |
| enclosure | " |
| escape | \ |
| enabled | yes |
| categories column | categories |
| family column | families |
| groups column | groups |
And I am logged in as "Julia"
Scenario: Successfully import a csv file of products
Given the following file to import:
"""
sku;family;groups;categories;name;description
SKU-001;Bag;CROSS;leather,travel;Donec;dictum magna. Ut tincidunt orci quis lectus. Nullam suscipit, est
SKU-002;Hat;;travel;Donex;Pellentesque habitant morbi tristique senectus et netus et malesuada fames
SKU-003;Hat;;men;ac;Morbi quis urna. Nunc quis arcu vel quam dignissim pharetra.
SKU-004;Hat;;men;nec;justo sit amet nulla. Donec non justo. Proin non massa
SKU-005;Bag;CROSS;women,silk;non;tincidunt dui augue eu tellus. Phasellus elit pede, malesuada vel
SKU-006;Bag;CROSS;leather;ipsum;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam auctor,
SKU-007;Hat;;;rutrum.;quis, pede. Praesent eu dui. Cum sociis natoque penatibus et
SKU-008;Bag;CROSS;coton;ligula;urna et arcu imperdiet ullamcorper. Duis at lacus. Quisque purus
SKU-009;Hat;;;porttitor;sagittis. Duis gravida. Praesent eu nulla at sem molestie sodales.
SKU-010;Bag;CROSS;men,silk;non,;vestibulum nec, euismod in, dolor. Fusce feugiat. Lorem ipsum dolor
"""
And the following job "acme_product_import" configuration:
| filePath | {{ file to import }} |
When I am on the "acme_product_import" import job page
And I launch the import job
And I wait for the job to finish
Then there should be 10 products
And the family of the product "SKU-006" should be "Bag"
And product "SKU-007" should be enabled
And the product "SKU-001" should have the following value:
| name | Donec |
And the product "SKU-002" should have the following value:
| description | Pellentesque habitant morbi tristique senectus et netus et malesuada fames |
Scenario: Successfully ignore duplicate unique data
Given the following file to import:
"""
sku;family;groups;categories;name;description
SKU-001;Bag;;leather,travel;Donec;dictum magna. Ut tincidunt orci quis lectus. Nullam suscipit, est
SKU-001;Hat;;travel;Donex;Pellentesque habitant morbi tristique senectus et netus et malesuada fames
"""
And the following job "acme_product_import" configuration:
| filePath | {{ file to import }} |
When I am on the "acme_product_import" import job page
And I launch the import job
And I wait for the job to finish
Then I should see "The \"sku\" attribute is unique, the value \"SKU-001\" was already read in this file"
Then there should be 1 product
And the product "SKU-001" should have the following values:
| name | Donec |
| description | dictum magna. Ut tincidunt orci quis lectus. Nullam suscipit, est |
Scenario: Successfully update an existing product
Given a "SKU-001" product
Given the following product values:
| product | attribute | value |
| SKU-001 | name | FooBar |
Given the following file to import:
"""
sku;family;groups;categories;name;description
SKU-001;Bag;;leather,travel;Donec;dictum magna. Ut tincidunt orci quis lectus. Nullam suscipit, est
"""
And the following job "acme_product_import" configuration:
| filePath | {{ file to import }} |
When I am on the "acme_product_import" import job page
And I launch the import job
And I wait for the job to finish
Then there should be 1 product
And the product "SKU-001" should have the following values:
| name | Donec |
| description | dictum magna. Ut tincidunt orci quis lectus. Nullam suscipit, est |
Scenario: Successfully import products through file upload
Given the following file to import:
"""
sku;family;groups;categories;name;description
SKU-001;Bag;;leather,travel;Donec;dictum magna. Ut tincidunt orci quis lectus. Nullam suscipit, est
SKU-002;Hat;;travel;Donex;Pellentesque habitant morbi tristique senectus et netus et malesuada fames
SKU-003;Hat;;men;ac;Morbi quis urna. Nunc quis arcu vel quam dignissim pharetra.
SKU-004;Hat;;men;nec;justo sit amet nulla. Donec non justo. Proin non massa
SKU-005;Bag;;women,silk;non;tincidunt dui augue eu tellus. Phasellus elit pede, malesuada vel
SKU-006;Bag;;leather;ipsum;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam auctor,
SKU-007;Hat;;;rutrum.;quis, pede. Praesent eu dui. Cum sociis natoque penatibus et
SKU-008;Bag;;coton;ligula;urna et arcu imperdiet ullamcorper. Duis at lacus. Quisque purus
SKU-009;Hat;;;porttitor;sagittis. Duis gravida. Praesent eu nulla at sem molestie sodales.
SKU-010;Bag;;men,silk;non,;vestibulum nec, euismod in, dolor. Fusce feugiat. Lorem ipsum dolor
"""
And the following job "acme_product_import" configuration:
| uploadAllowed | yes |
When I am on the "acme_product_import" import job page
And I upload and import the file "{{ file to import }}"
Then there should be 10 products
Scenario: Successfully import products prices
Given the following file to import:
"""
sku;prices
SKU-001;"100 EUR, 90 USD"
SKU-002;50 EUR
"""
And the following job "acme_product_import" configuration:
| filePath | {{ file to import }} |
When I am on the "acme_product_import" import job page
And I launch the import job
And I wait for the job to finish
Then there should be 2 products
And the product "SKU-001" should have the following value:
| prices | 100.00 EUR, 90.00 USD |
And the product "SKU-002" should have the following value:
| prices | 50.00 EUR |
Scenario: Successfully update existing products prices
Given a "SKU-001" product
And the following product values:
| product | attribute | value |
| SKU-001 | Prices | 100 EUR, 150 USD |
And the following file to import:
"""
sku;prices
SKU-001;"100 EUR, 90 USD"
"""
And the following job "acme_product_import" configuration:
| filePath | {{ file to import }} |
When I am on the "acme_product_import" import job page
And I launch the import job
And I wait for the job to finish
Then there should be 1 products
And the product "SKU-001" should have the following value:
| prices | 100.00 EUR, 90.00 USD |
Scenario: Successfully import products metrics
Given the following file to import:
"""
sku;weight
SKU-001;4000 GRAM
"""
And the following job "acme_product_import" configuration:
| filePath | {{ file to import }} |
When I am on the "acme_product_import" import job page
And I launch the import job
And I wait for the job to finish
Then there should be 1 products
And the product "SKU-001" should have the following value:
| weight | 4000.0000 GRAM |
Scenario: Successfully import products metrics splitting the data and unit
Given the following file to import:
"""
sku;weight;weight-unit
SKU-001;4000;GRAM
"""
And the following job "acme_product_import" configuration:
| filePath | {{ file to import }} |
When I am on the "acme_product_import" import job page
And I launch the import job
And I wait for the job to finish
Then there should be 1 products
And the product "SKU-001" should have the following value:
| weight | 4000.0000 GRAM |