-
Notifications
You must be signed in to change notification settings - Fork 186
/
Copy pathuploadFile.feature
436 lines (385 loc) · 19.5 KB
/
uploadFile.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
Feature: upload file
As a user
I want to be able to upload files
So that I can store and share files between multiple client systems
Background:
Given using OCS API version "1"
And user "Alice" has been created with default attributes and without skeleton files
@smokeTest
Scenario Outline: upload a file and check etag and download content
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "uploaded content" to "<file_name>" using the WebDAV API
Then the HTTP status code should be "201"
And the following headers should match these regular expressions for user "Alice"
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "<file_name>" for user "Alice" should be "uploaded content"
Examples:
| dav-path-version | file_name |
| old | /upload.txt |
| old | /नेपाली.txt |
| old | /strängé file.txt |
| old | /s,a,m,p,l,e.txt |
| new | /upload.txt |
| new | /नेपाली.txt |
| new | /strängé file.txt |
| new | /s,a,m,p,l,e.txt |
@skipOnRevaMaster
Examples:
| dav-path-version | file_name |
| spaces | /upload.txt |
| spaces | /नेपाली.txt |
| spaces | /strängé file.txt |
| spaces | /s,a,m,p,l,e.txt |
Scenario Outline: upload a file and check download content
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "uploaded content" to <file_name> using the WebDAV API
Then the HTTP status code should be "201"
And the content of file <file_name> for user "Alice" should be "uploaded content"
Examples:
| dav-path-version | file_name |
| old | "C++ file.cpp" |
| old | "file #2.txt" |
| new | "C++ file.cpp" |
| new | "file #2.txt" |
@skipOnRevaMaster
Examples:
| dav-path-version | file_name |
| spaces | "C++ file.cpp" |
| spaces | "file #2.txt" |
@issue-1259
#after fixing all issues delete this Scenario and merge with the one above
Scenario Outline: upload a file with character '?' in its name and check download content
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "uploaded content" to <file_name> using the WebDAV API
Then the HTTP status code should be "201"
And the content of file <file_name> for user "Alice" should be "uploaded content"
Examples:
| dav-path-version | file_name |
| old | "file ?2.txt" |
| old | " ?fi=le&%#2 . txt" |
| old | " # %ab ab?=ed " |
| new | "file ?2.txt" |
| new | " ?fi=le&%#2 . txt" |
| new | " # %ab ab?=ed " |
@skipOnRevaMaster
Examples:
| dav-path-version | file_name |
| spaces | "file ?2.txt" |
| spaces | " ?fi=le&%#2 . txt" |
| spaces | " # %ab ab?=ed " |
Scenario Outline: upload a file with comma in the filename and check download content
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "file with comma" to <file_name> using the WebDAV API
Then the HTTP status code should be "201"
And the content of file <file_name> for user "Alice" should be "file with comma"
Examples:
| dav-path-version | file_name |
| old | "sample,1.txt" |
| old | ",,,.txt" |
| old | ",,,.," |
| new | "sample,1.txt" |
| new | ",,,.txt" |
| new | ",,,.," |
@skipOnRevaMaster
Examples:
| dav-path-version | file_name |
| spaces | "sample,1.txt" |
| spaces | ",,,.txt" |
| spaces | ",,,.," |
Scenario Outline: upload a file into a folder and check download content
Given using <dav-path-version> DAV path
And user "Alice" has created folder "<folder_name>"
When user "Alice" uploads file with content "uploaded content" to "<folder_name>/<file_name>" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "<folder_name>/<file_name>" for user "Alice" should be "uploaded content"
Examples:
| dav-path-version | folder_name | file_name |
| old | /upload | abc.txt |
| old | /strängé folder | strängé file.txt |
| old | /C++ folder | C++ file.cpp |
| old | /नेपाली | नेपाली |
| old | /folder #2.txt | file #2.txt |
| new | /upload | abc.txt |
| new | /strängé folder (duplicate #2 &) | strängé file (duplicate #2 &) |
| new | /C++ folder | C++ file.cpp |
| new | /नेपाली | नेपाली |
| new | /folder #2.txt | file #2.txt |
@skipOnRevaMaster
Examples:
| dav-path-version | folder_name | file_name |
| spaces | /strängé folder | strängé file.txt |
| spaces | /upload | abc.txt |
| spaces | /C++ folder | C++ file.cpp |
| spaces | /नेपाली | नेपाली |
| spaces | /folder #2.txt | file #2.txt |
@issue-1259
#after fixing all issues delete this Scenario and merge with the one above
Scenario Outline: upload a file into a folder with character '?' in its name and check download content
Given using <dav-path-version> DAV path
And user "Alice" has created folder "<folder_name>"
When user "Alice" uploads file with content "uploaded content" to "<folder_name>/<file_name>" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "<folder_name>/<file_name>" for user "Alice" should be "uploaded content"
Examples:
| dav-path-version | folder_name | file_name |
| old | /folder ?2.txt | file ?2.txt |
| old | /?fi=le&%#2 . txt | # %ab ab?=ed |
| new | /folder ?2.txt | file ?2.txt |
| new | /?fi=le&%#2 . txt | # %ab ab?=ed |
@skipOnRevaMaster
Examples:
| dav-path-version | folder_name | file_name |
| spaces | /folder ?2.txt | file ?2.txt |
| spaces | /?fi=le&%#2 . txt | # %ab ab?=ed |
Scenario Outline: attempt to upload a file into a nonexistent folder
Given using <dav-path-version> DAV path
When user "Alice" uploads file with content "uploaded content" to "nonexistent-folder/new-file.txt" using the WebDAV API
Then the HTTP status code should be "409"
And as "Alice" folder "nonexistent-folder" should not exist
And as "Alice" file "nonexistent-folder/new-file.txt" should not exist
Examples:
| dav-path-version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav-path-version |
| spaces |
@issue-1345
Scenario Outline: uploading file to path with extension .part should not be possible
Given using <dav-path-version> DAV path
When user "Alice" uploads file "filesForUpload/textfile.txt" to "/textfile.part" using the WebDAV API
Then the HTTP status code should be "400"
And the DAV exception should be "OCA\DAV\Connector\Sabre\Exception\InvalidPath"
And the DAV message should be "Can`t upload files with extension .part because these extensions are reserved for internal use."
And the DAV reason should be "Can`t upload files with extension .part because these extensions are reserved for internal use."
And user "Alice" should not see the following elements
| /textfile.part |
Examples:
| dav-path-version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav-path-version |
| spaces |
Scenario Outline: upload a file into a folder with dots in the path and check download content
Given using <dav-path-version> DAV path
And user "Alice" has created folder "<folder_name>"
When user "Alice" uploads file with content "uploaded content for file name ending with a dot" to "<folder_name>/<file_name>" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "/<folder_name>/<file_name>" should exist
And the content of file "<folder_name>/<file_name>" for user "Alice" should be "uploaded content for file name ending with a dot"
Examples:
| dav-path-version | folder_name | file_name |
| old | /upload. | abc. |
| old | /upload. | abc . |
| old | /upload.1 | abc.txt |
| old | /upload...1.. | abc...txt.. |
| old | /... | ... |
| new | /..upload | ..abc |
| new | /upload. | abc. |
| new | /upload. | abc . |
| new | /upload.1 | abc.txt |
| new | /upload...1.. | abc...txt.. |
| new | /... | ... |
@skipOnRevaMaster
Examples:
| dav-path-version | folder_name | file_name |
| spaces | /upload. | abc. |
| spaces | /upload. | abc . |
| spaces | /upload.1 | abc.txt |
| spaces | /upload...1.. | abc...txt.. |
| spaces | /... | ... |
Scenario Outline: upload file with mtime
Given using <dav-path-version> DAV path
When user "Alice" uploads file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "file.txt" should exist
And as "Alice" the mtime of the file "file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
Examples:
| dav-path-version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav-path-version |
| spaces |
@issue-1248
Scenario Outline: upload an empty file with mtime
Given using <dav_version> DAV path
When user "Alice" uploads file "filesForUpload/zerobyte.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "file.txt" should exist
And as "Alice" the mtime of the file "file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
Examples:
| dav_version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav_version |
| spaces |
Scenario Outline: upload a file with mtime in a folder
Given using <dav-path-version> DAV path
And user "Alice" has created folder "testFolder"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "/testFolder/file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "/testFolder/file.txt" should exist
And as "Alice" the mtime of the file "/testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
Examples:
| dav-path-version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav-path-version |
| spaces |
@issue-1248
Scenario Outline: upload an empty file with mtime in a folder
Given using <dav_version> DAV path
And user "Alice" has created folder "testFolder"
When user "Alice" uploads file "filesForUpload/zerobyte.txt" to "/testFolder/file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "/testFolder/file.txt" should exist
And as "Alice" the mtime of the file "/testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
Examples:
| dav_version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav_version |
| spaces |
Scenario Outline: moving a file does not change its mtime
Given using <dav-path-version> DAV path
And user "Alice" has created folder "testFolder"
When user "Alice" uploads file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API
And user "Alice" moves file "file.txt" to "/testFolder/file.txt" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "/testFolder/file.txt" should exist
And as "Alice" the mtime of the file "/testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
Examples:
| dav-path-version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav-path-version |
| spaces |
Scenario Outline: overwriting a file changes its mtime
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "first time upload content" to "file.txt"
When user "Alice" uploads a file with content "Overwrite file" and mtime "Thu, 08 Aug 2019 04:18:13 GMT" to "file.txt" using the WebDAV API
Then the HTTP status code should be "204"
And as "Alice" file "file.txt" should exist
And as "Alice" the mtime of the file "file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
And the content of file "file.txt" for user "Alice" should be "Overwrite file"
Examples:
| dav-path-version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav-path-version |
| spaces |
Scenario Outline: upload a hidden file and check download content
Given using <dav-path-version> DAV path
And user "Alice" has created folder "/FOLDER"
When user "Alice" uploads the following files with content "hidden file"
| path |
| .hidden_file |
| /FOLDER/.hidden_file |
Then the HTTP status code of responses on all endpoints should be "201"
And as "Alice" the following files should exist
| path |
| .hidden_file |
| /FOLDER/.hidden_file |
And the content of the following files for user "Alice" should be "hidden file"
| path |
| .hidden_file |
| /FOLDER/.hidden_file |
Examples:
| dav-path-version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav-path-version |
| spaces |
Scenario Outline: upload a file of size zero byte
Given using <dav-path-version> DAV path
When user "Alice" uploads file "filesForUpload/zerobyte.txt" to "/zerobyte.txt" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "zerobyte.txt" should exist
Examples:
| dav-path-version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav-path-version |
| spaces |
@issue-7257
Scenario Outline: user updates a file with empty content
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "file with content" to "/textfile.txt"
When user "Alice" uploads file with content "" to "/textfile.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the content of file "/textfile.txt" for user "Alice" should be ""
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@issue-7257
Scenario Outline: user updates a file inside a folder with empty content
Given using <dav-path-version> DAV path
And user "Alice" has created folder "testFolder"
And user "Alice" has uploaded file with content "file with content" to "testFolder/textfile.txt"
When user "Alice" uploads file with content "" to "testFolder/textfile.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the content of file "testFolder/textfile.txt" for user "Alice" should be ""
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@skipOnReva @issue-7257
Scenario Outline: user updates a shared file with empty content
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "file with content" to "/textfile.txt"
And user "Alice" has shared file "/textfile.txt" with user "Brian" with permissions "read,update"
When user "Brian" uploads file with content "" to shared resource "Shares/textfile.txt" using the WebDAV API
Then the HTTP status code should be "204"
And for user "Brian" the content of the file "/test.txt" of the space "Shares" should be ""
And the content of file "/textfile.txt" for user "Alice" should be ""
Examples:
| dav-path-version |
| old |
| new |
| spaces |
@skipOnReva @issue-7257
Scenario: user updates a file inside a project space with empty content
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "new-space" with content "file with content" to "textfile.txt"
When user "Alice" uploads a file inside space "new-space" with content "" to "textfile.txt" using the WebDAV API
Then the HTTP status code should be "204"
And for user "Alice" the content of the file "/textfile.txt" of the space "new-space" should be ""
@skipOnReva @issue-7257
Scenario: user updates a file inside a shared space with empty content
Given using spaces DAV path
And user "Brian" has been created with default attributes and without skeleton files
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "new-space" with content "file with content" to "textfile.txt"
And user "Alice" has shared a space "new-space" with settings:
| shareWith | Brian |
| role | editor |
When user "Brian" uploads a file inside space "new-space" with content "" to "textfile.txt" using the WebDAV API
Then the HTTP status code should be "204"
And for user "Brian" the content of the file "/textfile.txt" of the space "new-space" should be ""
And for user "Alice" the content of the file "/textfile.txt" of the space "new-space" should be ""