-
Notifications
You must be signed in to change notification settings - Fork 189
/
Copy pathgetFileProperties.feature
630 lines (555 loc) · 25.4 KB
/
getFileProperties.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
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
@api
Feature: get file properties
As a user
I want to be able to get meta-information about files
So that I can know file meta-information (detailed requirement TBD)
Background:
Given using OCS API version "1"
And user "Alice" has been created with default attributes and without skeleton files
@smokeTest
Scenario Outline: Do a PROPFIND of various file names
Given using <dav_version> DAV path
And user "Alice" has uploaded file with content "uploaded content" to "<file_name>"
When user "Alice" gets the properties of file "<file_name>" using the WebDAV API
Then the HTTP status code should be "201"
And the properties response should contain an etag
Examples:
| dav_version | file_name |
| old | /upload.txt |
| old | /strängé file.txt |
| old | /नेपाली.txt |
| old | s,a,m,p,l,e.txt |
| new | /upload.txt |
| new | /strängé file.txt |
| new | /नेपाली.txt |
| new | s,a,m,p,l,e.txt |
@personalSpace
Examples:
| dav_version | file_name |
| spaces | /upload.txt |
| spaces | /strängé file.txt |
| spaces | /नेपाली.txt |
| spaces | s,a,m,p,l,e.txt |
@issue-1296
Scenario Outline: Do a PROPFIND of various file names
Given using <dav_version> DAV path
And user "Alice" has uploaded file with content "uploaded content" to "<file_name>"
When user "Alice" gets the properties of file "<file_name>" using the WebDAV API
Then the HTTP status code should be "201"
And the properties response should contain an etag
And there should be an entry with href containing "<expected_href>" in the response to user "Alice"
Examples:
| dav_version | file_name | expected_href |
| old | /C++ file.cpp | remote.php/webdav/C++ file.cpp |
| old | /file #2.txt | remote.php/webdav/file #2.txt |
| old | /file ?2.txt | remote.php/webdav/file ?2.txt |
| old | /file &2.txt | remote.php/webdav/file &2.txt |
| new | /C++ file.cpp | remote.php/dav/files/%username%/C++ file.cpp |
| new | /file #2.txt | remote.php/dav/files/%username%/file #2.txt |
| new | /file ?2.txt | remote.php/dav/files/%username%/file ?2.txt |
| new | /file &2.txt | remote.php/dav/files/%username%/file &2.txt |
@personalSpace
Examples:
| dav_version | file_name | expected_href |
| spaces | /C++ file.cpp | dav/spaces/%spaceid%/C++ file.cpp |
| spaces | /file #2.txt | dav/spaces/%spaceid%/file #2.txt |
| spaces | /file ?2.txt | dav/spaces/%spaceid%/file ?2.txt |
| spaces | /file &2.txt | dav/spaces/%spaceid%/file &2.txt |
@issue-1296
Scenario Outline: Do a PROPFIND of various folder names
Given using <dav_version> DAV path
And user "Alice" has created folder "<folder_name>"
And user "Alice" has uploaded file with content "uploaded content" to "<folder_name>/file1.txt"
And user "Alice" has uploaded file with content "uploaded content" to "<folder_name>/file2.txt"
When user "Alice" gets the properties of folder "<folder_name>" with depth 1 using the WebDAV API
Then the HTTP status code should be "201"
And there should be an entry with href containing "<expected_href>/" in the response to user "Alice"
And there should be an entry with href containing "<expected_href>/file1.txt" in the response to user "Alice"
And there should be an entry with href containing "<expected_href>/file2.txt" in the response to user "Alice"
Examples:
| dav_version | folder_name | expected_href |
| old | /upload | remote.php/webdav/upload |
| old | /strängé folder | remote.php/webdav/strängé folder |
| old | /C++ folder | remote.php/webdav/C++ folder |
| old | /नेपाली | remote.php/webdav/नेपाली |
| old | /folder #2.txt | remote.php/webdav/folder #2.txt |
| old | /folder ?2.txt | remote.php/webdav/folder ?2.txt |
| old | /folder &2.txt | remote.php/webdav/folder &2.txt |
| new | /upload | remote.php/dav/files/%username%/upload |
| new | /strängé folder | remote.php/dav/files/%username%/strängé folder |
| new | /C++ folder | remote.php/dav/files/%username%/C++ folder |
| new | /नेपाली | remote.php/dav/files/%username%/नेपाली |
| new | /folder #2.txt | remote.php/dav/files/%username%/folder #2.txt |
| new | /folder ?2.txt | remote.php/dav/files/%username%/folder ?2.txt |
| new | /folder &2.txt | remote.php/dav/files/%username%/folder &2.txt |
@personalSpace
Examples:
| dav_version | folder_name | expected_href |
| spaces | /upload | dav/spaces/%spaceid%/upload |
| spaces | /strängé folder | dav/spaces/%spaceid%/strängé folder |
| spaces | /C++ folder | dav/spaces/%spaceid%/C++ folder |
| spaces | /नेपाली | dav/spaces/%spaceid%/नेपाली |
| spaces | /folder #2.txt | dav/spaces/%spaceid%/folder #2.txt |
| spaces | /folder ?2.txt | dav/spaces/%spaceid%/folder ?2.txt |
| spaces | /folder &2.txt | dav/spaces/%spaceid%/folder &2.txt |
Scenario Outline: Do a PROPFIND of various files inside various folders
Given using <dav_version> DAV path
And user "Alice" has created folder "<folder_name>"
And user "Alice" has uploaded file with content "uploaded content" to "<folder_name>/<file_name>"
When user "Alice" gets the properties of file "<folder_name>/<file_name>" using the WebDAV API
Then the HTTP status code should be "201"
And the properties response should contain an etag
Examples:
| dav_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 |
@personalSpace
Examples:
| dav_version | folder_name | file_name |
| spaces | /upload | abc.txt |
| spaces | /strängé folder | strängé file.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: Do a PROPFIND of various files inside various folders
Given using <dav_version> DAV path
And user "Alice" has created folder "<folder_name>"
And user "Alice" has uploaded file with content "uploaded content" to "<folder_name>/<file_name>"
When user "Alice" gets the properties of file "<folder_name>/<file_name>" using the WebDAV API
Then the HTTP status code should be "201"
And the properties response should contain an etag
Examples:
| dav_version | folder_name | file_name |
| old | /folder ?2.txt | file ?2.txt |
| new | /folder ?2.txt | file ?2.txt |
@personalSpace
Examples:
| dav_version | folder_name | file_name |
| spaces | /folder ?2.txt | file ?2.txt |
Scenario Outline: A file that is not shared does not have a share-types property
Given using <dav_version> DAV path
And user "Alice" has created folder "/test"
When user "Alice" gets the following properties of folder "/test" using the WebDAV API
| propertyName |
| oc:share-types |
Then the HTTP status code should be "201"
And the response should contain an empty property "oc:share-types"
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: A file that is shared to a user has a share-types property
Given using <dav_version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/test"
And user "Alice" has created a share with settings
| path | test |
| shareType | user |
| permissions | all |
| shareWith | Brian |
When user "Alice" gets the following properties of folder "/test" using the WebDAV API
| propertyName |
| oc:share-types |
Then the HTTP status code should be "200"
And the response should contain a share-types property with
| 0 |
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: A file that is shared to a group has a share-types property
Given using <dav_version> DAV path
And group "grp1" has been created
And user "Alice" has created folder "/test"
And user "Alice" has created a share with settings
| path | test |
| shareType | group |
| permissions | all |
| shareWith | grp1 |
When user "Alice" gets the following properties of folder "/test" using the WebDAV API
| propertyName |
| oc:share-types |
Then the HTTP status code should be "200"
And the response should contain a share-types property with
| 1 |
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: A file that is shared by link has a share-types property
Given using <dav_version> DAV path
And user "Alice" has created folder "/test"
And user "Alice" has created a public link share with settings
| path | test |
| permissions | all |
When user "Alice" gets the following properties of folder "/test" using the WebDAV API
| propertyName |
| oc:share-types |
Then the HTTP status code should be "200"
And the response should contain a share-types property with
| 3 |
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
@skipOnLDAP @user_ldap-issue-268
Scenario Outline: A file that is shared by user,group and link has a share-types property
Given using <dav_version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And group "grp1" has been created
And user "Alice" has created folder "/test"
And user "Alice" has created a share with settings
| path | test |
| shareType | user |
| permissions | all |
| shareWith | Brian |
And user "Alice" has created a share with settings
| path | test |
| shareType | group |
| permissions | all |
| shareWith | grp1 |
And user "Alice" has created a public link share with settings
| path | test |
| permissions | all |
When user "Alice" gets the following properties of folder "/test" using the WebDAV API
| propertyName |
| oc:share-types |
Then the HTTP status code should be "200"
And the response should contain a share-types property with
| 0 |
| 1 |
| 3 |
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
@smokeTest @issue-2809
Scenario Outline: Retrieving private link
Given using <dav_version> DAV path
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/somefile.txt"
When user "Alice" gets the following properties of file "/somefile.txt" using the WebDAV API
| propertyName |
| oc:privatelink |
Then the HTTP status code should be "201"
And the single response should contain a property "oc:privatelink" with value like "%(/(index.php/)?f/[0-9]*)%"
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Do a PROPFIND to a nonexistent URL
When user "Alice" requests "<url>" with "PROPFIND" using basic auth
Then the HTTP status code should be "404"
And the value of the item "/d:error/s:message" in the response about user "Alice" should be "<message1>" or "<message2>"
And the value of the item "/d:error/s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"
Examples:
| url | message1 | message2 |
| /remote.php/dav/files/does-not-exist | Resource not found | Resource not found |
| /remote.php/dav/does-not-exist | File not found in root | |
@personalSpace
Examples:
| url | message1 | message2 |
| /remote.php/dav/spaces/%spaceid%/does-not-exist | Resource not found | |
| /remote.php/dav/spaces/%spaceid%/file1.txt | Resource not found | |
@issue-1297
Scenario Outline: add, receive multiple custom meta properties to a file
Given using <dav_version> DAV path
And user "Alice" has created folder "/TestFolder"
And user "Alice" has uploaded file with content "test data one" to "/TestFolder/test1.txt"
And user "Alice" has set the following properties of file "/TestFolder/test1.txt" using the WebDav API
| propertyName | propertyValue |
| testprop1 | AAAAA |
| testprop2 | BBBBB |
When user "Alice" gets the following properties of file "/TestFolder/test1.txt" using the WebDAV API
| propertyName |
| oc:testprop1 |
| oc:testprop2 |
Then the HTTP status code should be success
And as user "Alice" the last response should have the following properties
| resource | propertyName | propertyValue |
| /TestFolder/test1.txt | testprop1 | AAAAA |
| /TestFolder/test1.txt | testprop2 | BBBBB |
| /TestFolder/test1.txt | status | HTTP/1.1 200 OK |
Examples:
| dav_version |
| new |
| old |
@personalSpace
Examples:
| dav_version |
| spaces |
@issue-1297
Scenario Outline: add multiple properties to files inside a folder and do a propfind of the parent folder
Given using <dav_version> DAV path
And user "Alice" has created folder "/TestFolder"
And user "Alice" has uploaded file with content "test data one" to "/TestFolder/test1.txt"
And user "Alice" has uploaded file with content "test data two" to "/TestFolder/test2.txt"
And user "Alice" has set the following properties of file "/TestFolder/test1.txt" using the WebDav API
| propertyName | propertyValue |
| testprop1 | AAAAA |
| testprop2 | BBBBB |
And user "Alice" has set the following properties of file "/TestFolder/test2.txt" using the WebDav API
| propertyName | propertyValue |
| testprop1 | CCCCC |
| testprop2 | DDDDD |
When user "Alice" gets the following properties of folder "/TestFolder" using the WebDAV API
| propertyName |
| oc:testprop1 |
| oc:testprop2 |
Then the HTTP status code should be success
And as user "Alice" the last response should have the following properties
| resource | propertyName | propertyValue |
| /TestFolder/test1.txt | testprop1 | AAAAA |
| /TestFolder/test1.txt | testprop2 | BBBBB |
| /TestFolder/test2.txt | testprop1 | CCCCC |
| /TestFolder/test2.txt | testprop2 | DDDDD |
| /TestFolder/ | status | HTTP/1.1 404 Not Found |
Examples:
| dav_version |
| new |
| old |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the last modified date of a folder using webdav api
Given using <dav_version> DAV path
And user "Alice" has created folder "/test"
When user "Alice" gets the following properties of folder "/test" using the WebDAV API
| propertyName |
| d:getlastmodified |
Then the HTTP status code should be "201"
And the single response should contain a property "d:getlastmodified" with value like "/^[MTWFS][uedhfriatno]{2},\s(\d){2}\s[JFMAJSOND][anebrpyulgctov]{2}\s\d{4}\s\d{2}:\d{2}:\d{2} GMT$/"
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the content type of a folder using webdav api
Given using <dav_version> DAV path
And user "Alice" has created folder "/test"
When user "Alice" gets the following properties of folder "/test" using the WebDAV API
| propertyName |
| d:getcontenttype |
Then the HTTP status code should be "201"
And the single response should contain a property "d:getcontenttype" with value ""
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the content type of a file using webdav api
Given using <dav_version> DAV path
And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
When user "Alice" gets the following properties of folder "file.txt" using the WebDAV API
| propertyName |
| d:getcontenttype |
Then the HTTP status code should be "201"
And the single response should contain a property "d:getcontenttype" with value "text/plain.*"
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the etag of a file using webdav api
Given using <dav_version> DAV path
And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
When user "Alice" gets the following properties of folder "file.txt" using the WebDAV API
| propertyName |
| d:getetag |
Then the HTTP status code should be "201"
And the single response should contain a property "d:getetag" with value like '%\"[a-z0-9:]{1,32}\"%'
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the resource type of a file using webdav api
Given using <dav_version> DAV path
And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
When user "Alice" gets the following properties of folder "file.txt" using the WebDAV API
| propertyName |
| d:resourcetype |
Then the HTTP status code should be "201"
And the single response should contain a property "d:resourcetype" with value ""
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the size of a file using webdav api
Given using <dav_version> DAV path
And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
When user "Alice" gets the following properties of folder "file.txt" using the WebDAV API
| propertyName |
| oc:size |
Then the HTTP status code should be "201"
And the single response should contain a property "oc:size" with value "16"
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the size of a folder using webdav api
Given using <dav_version> DAV path
And user "Alice" has created folder "/test"
When user "Alice" gets the following properties of folder "/test" using the WebDAV API
| propertyName |
| oc:size |
Then the HTTP status code should be "201"
And the single response should contain a property "oc:size" with value "0"
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the file id of a file using webdav api
Given using <dav_version> DAV path
And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
When user "Alice" gets the following properties of folder "file.txt" using the WebDAV API
| propertyName |
| oc:fileid |
Then the HTTP status code should be "201"
And the single response should contain a property "oc:fileid" with value like '/[a-zA-Z0-9]+/'
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the file id of a folder using webdav api
Given using <dav_version> DAV path
And user "Alice" has created folder "/test"
When user "Alice" gets the following properties of folder "/test" using the WebDAV API
| propertyName |
| oc:fileid |
Then the HTTP status code should be "201"
And the single response should contain a property "oc:fileid" with value like '/[a-zA-Z0-9]+/'
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the owner display name of a file using webdav api
Given using <dav_version> DAV path
And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
When user "Alice" gets the following properties of file "file.txt" using the WebDAV API
| propertyName |
| oc:owner-display-name |
Then the HTTP status code should be "201"
And the single response about the file owned by "Alice" should contain a property "oc:owner-display-name" with value "%displayname%"
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the owner display name of a folder using webdav api
Given using <dav_version> DAV path
And user "Alice" has created folder "/test"
When user "Alice" gets the following properties of folder "/test" using the WebDAV API
| propertyName |
| oc:owner-display-name |
Then the HTTP status code should be "201"
And the single response about the file owned by "Alice" should contain a property "oc:owner-display-name" with value "%displayname%"
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the permissions on a file using webdav api
Given using <dav_version> DAV path
And user "Alice" has uploaded file with content "uploaded content" to "file.txt"
When user "Alice" gets the following properties of folder "file.txt" using the WebDAV API
| propertyName |
| oc:permissions |
Then the HTTP status code should be "201"
And the single response should contain a property "oc:permissions" with value like '/RM{0,1}DNVW/'
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |
Scenario Outline: Propfind the permissions on a folder using webdav api
Given using <dav_version> DAV path
And user "Alice" has created folder "/test"
When user "Alice" gets the following properties of folder "/test" using the WebDAV API
| propertyName |
| oc:permissions |
Then the HTTP status code should be "201"
And the single response should contain a property "oc:permissions" with value like '/RM{0,1}DNVCK/'
Examples:
| dav_version |
| old |
| new |
@personalSpace
Examples:
| dav_version |
| spaces |