-
Notifications
You must be signed in to change notification settings - Fork 140
Expand file tree
/
Copy pathwopi.feature
More file actions
378 lines (349 loc) Β· 17 KB
/
wopi.feature
File metadata and controls
378 lines (349 loc) Β· 17 KB
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
Feature: WOPI
Background:
Given user "user1" exists
Given user "user2" exists
Scenario: Create a new wopi token for a user and open it
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file.odt"
Then User "user1" opens "/file.odt"
And Collabora fetches checkFileInfo
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | file.odt |
| OwnerId | user1 |
| UserId | user1 |
| UserFriendlyName | user1-displayname |
And checkFileInfo "UserCanWrite" is true
Scenario: Fetch checkFileInfo for public share link
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file.odt"
And as "user1" create a share with
| path | /file.odt |
| shareType | 3 |
Then Using web as guest
And a guest opens the share link
And Collabora fetches checkFileInfo
And checkFileInfo "BaseFileName" is "file.odt"
And checkFileInfo "UserId" matches "/Guest-/"
And checkFileInfo "OwnerId" is "user1"
And checkFileInfo "UserCanWrite" is false
And Collabora saved the file with the content of "./../emptyTemplates/template.ods"
And the WOPI HTTP status code should be "403"
And Collabora downloads the file
Then the file is equal to "./../emptyTemplates/template.odt"
Scenario: Open a file in a folder shared by link
Given as user "user1"
And User "user1" creates a folder "NewFolder"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/NewFolder/file.odt"
And as "user1" create a share with
| path | /NewFolder |
| shareType | 3 |
Then User "user1" opens "/NewFolder/file.odt"
And Collabora fetches checkFileInfo
Then Using web as guest
And a guest opens the file "file.odt" of the shared link
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | file.odt |
| UserCanWrite | |
| OwnerId | user1 |
And checkFileInfo "UserId" matches "/Guest-/"
And Collabora downloads the file and it is equal to "./../emptyTemplates/template.odt"
And Collabora can not save the file with the content of "./../emptyTemplates/template.ods"
Then both Collabora files used the same file id
Scenario: Open a file in a folder shared by link with a guest name
Given as user "user1"
And User "user1" creates a folder "NewFolder"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/NewFolder/file.odt"
And as "user1" create a share with
| path | /NewFolder |
| shareType | 3 |
Then User "user1" opens "/NewFolder/file.odt"
And Collabora fetches checkFileInfo
Then Using web as guest
And a guest opens the file "file.odt" of the shared link as "Anonymous"
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | file.odt |
| UserCanWrite | |
| OwnerId | user1 |
| UserFriendlyName | Anonymous (Guest) |
And checkFileInfo "UserId" matches "/Guest-/"
And Collabora downloads the file and it is equal to "./../emptyTemplates/template.odt"
And Collabora can not save the file with the content of "./../emptyTemplates/template.ods"
Then both Collabora files used the same file id
Scenario: Open a file in a folder shared by link as the owner
Given as user "user1"
And User "user1" creates a folder "NewFolder"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/NewFolder/file.odt"
And as "user1" create a share with
| path | /NewFolder |
| shareType | 3 |
Then User "user1" opens "/NewFolder/file.odt"
And Collabora fetches checkFileInfo
And User "user1" opens the file "file.odt" of the shared link
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | file.odt |
| UserCanWrite | |
| OwnerId | user1 |
| UserId | user1 |
And Collabora downloads the file and it is equal to "./../emptyTemplates/template.odt"
And Collabora can not save the file with the content of "./../emptyTemplates/template.ods"
Then both Collabora files used the same file id
Scenario: Fetch checkFileInfo for public share link as the owner
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file.odt"
And as "user1" create a share with
| path | /file.odt |
| shareType | 3 |
And the user opens the share link
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | file.odt |
| UserCanWrite | |
| OwnerId | user1 |
| UserId | user1 |
And Collabora downloads the file and it is equal to "./../emptyTemplates/template.odt"
And Collabora can not save the file with the content of "./../emptyTemplates/template.ods"
Scenario: Fetch checkFileInfo for public share link with download hidden
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file.odt"
And as "user1" create a share with
| path | /file.odt |
| shareType | 3 |
Then Using web as guest
And a guest opens the share link
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | file.odt |
| UserCanWrite | |
| OwnerId | user1 |
| DisablePrint | |
| DisableExport | |
| DisableCopy | |
| HidePrintOption | |
| HideExportOption | |
And Updating last share with
| hideDownload | true |
Then Using web as guest
And a guest opens the share link
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | file.odt |
| UserCanWrite | |
| OwnerId | user1 |
| DisablePrint | 1 |
| DisableExport | 1 |
| DisableCopy | 1 |
| HidePrintOption | 1 |
| HideExportOption | 1 |
Scenario: Fetch checkFileInfo for public share link with write permission
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file.odt"
And as "user1" create a share with
| path | /file.odt |
| shareType | 3 |
And Updating last share with
| permissions | 3 |
Then Using web as guest
And a guest opens the share link as "Anonymous"
And Collabora fetches checkFileInfo
And checkFileInfo "BaseFileName" is "file.odt"
And checkFileInfo "UserId" matches "/Guest-/"
And checkFileInfo "OwnerId" is "user1"
And checkFileInfo "UserCanWrite" is true
And Collabora downloads the file
Then the file is equal to "./../emptyTemplates/template.odt"
And Collabora saved the file with the content of "./../emptyTemplates/template.odt"
And Collabora downloads the file
Then the file is equal to "./../emptyTemplates/template.odt"
Scenario: Save a file as the owner
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file.odt"
Then User "user1" opens "/file.odt"
And Collabora fetches checkFileInfo
And Collabora downloads the file
Then the file is equal to "./../emptyTemplates/template.odt"
And checkFileInfo "UserCanWrite" is true
And Collabora saved the file with the content of "./../emptyTemplates/template.odt"
And Collabora downloads the file
Then the file is equal to "./../emptyTemplates/template.odt"
Scenario: Save a file as guest with write permissions
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file.odt"
And as "user1" create a share with
| path | /file.odt |
| shareType | 3 |
And Updating last share with
| permissions | 3 |
And the HTTP status code should be "200"
Then Using web as guest
And a guest opens the share link as "My name"
And Collabora fetches checkFileInfo
And checkFileInfo "BaseFileName" is "file.odt"
And checkFileInfo "UserId" matches "/Guest-/"
And checkFileInfo "UserFriendlyName" is "My name (Guest)"
And checkFileInfo "OwnerId" is "user1"
And checkFileInfo "UserCanWrite" is true
And Collabora downloads the file
Then the file is equal to "./../emptyTemplates/template.odt"
And Collabora saved the file with the content of "./../emptyTemplates/template.ods"
And Collabora downloads the file
Then the file is equal to "./../emptyTemplates/template.ods"
Scenario: Save a file as guest without name with write permissions
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file.odt"
And as "user1" create a share with
| path | /file.odt |
| shareType | 3 |
And Updating last share with
| permissions | 3 |
And the HTTP status code should be "200"
Then Using web as guest
And a guest opens the share link without guest name
And Collabora fetches checkFileInfo
And checkFileInfo "BaseFileName" is "file.odt"
And checkFileInfo "UserId" matches "/Guest-/"
And checkFileInfo "UserFriendlyName" is "Anonymous guest"
And checkFileInfo "OwnerId" is "user1"
And checkFileInfo "UserCanWrite" is true
And Collabora downloads the file
Then the file is equal to "./../emptyTemplates/template.odt"
And Collabora saved the file with the content of "./../emptyTemplates/template.ods"
And Collabora downloads the file
Then the file is equal to "./../emptyTemplates/template.ods"
Scenario: Create different WOPI file ids
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file1.odt"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file2.odt"
Then User "user1" opens "/file1.odt"
And Collabora fetches checkFileInfo
Then User "user1" opens "/file2.odt"
And Collabora fetches checkFileInfo
Then both Collabora files used a different file id
Scenario: Open a shared file
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file-readonly.odt"
And as "user1" create a share with
| path | /file-readonly.odt |
| shareType | 0 |
| shareWith | user2 |
| permissions | 1 |
Then User "user2" opens "/file-readonly.odt"
And Collabora fetches checkFileInfo
And Collabora downloads the file and it is equal to "./../emptyTemplates/template.odt"
And checkFileInfo "UserCanWrite" is false
And Collabora can not save the file with the content of "./../emptyTemplates/template.ods"
Scenario: Open a shared file with write permissions
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file-rw.odt"
And as "user1" create a share with
| path | /file-rw.odt |
| shareType | 0 |
| shareWith | user2 |
| permissions | 31 |
Then User "user2" opens "/file-rw.odt"
And Collabora fetches checkFileInfo
And checkFileInfo "UserCanWrite" is true
And Collabora downloads the file and it is equal to "./../emptyTemplates/template.odt"
And Collabora can save the file with the content of "./../emptyTemplates/template.ods"
Scenario: Open a reshared file with read permissions
Given user "user3" exists
When as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file-reshare-ro.odt"
And as "user1" create a share with
| path | /file-reshare-ro.odt |
| shareType | 0 |
| shareWith | user2 |
| permissions | 31 |
And as user "user2"
And as "user2" create a share with
| path | /file-reshare-ro.odt |
| shareType | 0 |
| shareWith | user3 |
| permissions | 1 |
Then User "user3" opens "/file-reshare-ro.odt"
And Collabora fetches checkFileInfo
And Collabora downloads the file
Then the file is equal to "./../emptyTemplates/template.odt"
And checkFileInfo "UserCanWrite" is false
And Collabora downloads the file and it is equal to "./../emptyTemplates/template.odt"
Scenario: Create a new wopi token from a template for a user and open it
Given as user "user1"
And user "user1" fetches the document template list
And user "user1" creates a new file "/file.odt" from a template
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | file.odt |
| OwnerId | user1 |
| UserId | user1 |
| UserFriendlyName | user1-displayname |
And checkFileInfo "UserCanWrite" is true
And TemplateSource is set
Scenario: Save as
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file-origin.odt"
Then User "user1" opens "/file-origin.odt"
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | file-origin.odt |
| OwnerId | user1 |
| UserId | user1 |
| UserFriendlyName | user1-displayname |
And checkFileInfo "UserCanWrite" is true
And Collabora saves the content of "./../emptyTemplates/template.ods" as "saveas.odt"
And the WOPI HTTP status code should be "200"
Then User "user1" opens "/saveas.odt"
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | saveas.odt |
| OwnerId | user1 |
| UserId | user1 |
| UserFriendlyName | user1-displayname |
And Collabora downloads the file
And Collabora downloads the file and it is equal to "./../emptyTemplates/template.ods"
Scenario: Save as different user
Given as user "user1"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/file-origin.odt"
And as "user1" create a share with
| path | /file-origin.odt |
| shareType | 0 |
| shareWith | user2 |
| permissions | 31 |
Then User "user2" opens "/file-origin.odt"
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | file-origin.odt |
| OwnerId | user1 |
| UserId | user2 |
| UserFriendlyName | user2-displayname |
And Collabora saves the content of "./../emptyTemplates/template.ods" as "/saveas.odt"
And the WOPI HTTP status code should be "200"
Then User "user2" opens "/saveas.odt"
And Collabora fetches and receives the following in the checkFileInfo response
| BaseFileName | saveas.odt |
| OwnerId | user2 |
| UserId | user2 |
| UserFriendlyName | user2-displayname |
And Collabora downloads the file
And Collabora downloads the file and it is equal to "./../emptyTemplates/template.ods"
Scenario: Save as guest user to owner root
Given as user "user1"
And User "user1" creates a folder "SharedFolder"
And as "user1" create a share with
| path | /SharedFolder |
| shareType | 3 |
And Updating last share with
| permissions | 31 |
And Create new document as guest with file name "some-guest-document.odt"
And as "user1" the file "/SharedFolder/some-guest-document.odt" exists
And a guest opens the file "some-guest-document.odt" of the shared link
And Collabora fetches checkFileInfo
And Collabora saves the content of "./../emptyTemplates/template.ods" as "/saved-as-guest-document.odt"
And as "user1" the file "/SharedFolder/saved-as-guest-document.odt" exists
And as "user1" the file "/saved-as-guest-document.odt" does not exist
Scenario: Rename file on share link
Given as user "user1"
And User "user1" creates a folder "/SharedFolder"
And User "user1" uploads file "./../emptyTemplates/template.odt" to "/SharedFolder/file.odt"
And as "user1" create a share with
| path | /SharedFolder |
| shareType | 3 |
And Updating last share with
| permissions | 31 |
And User "user1" opens the file "file.odt" of the shared link
And Collabora fetches checkFileInfo
And as "user1" rename "/SharedFolder/file.odt" to "renamed_file"
And as "user1" the file "/SharedFolder/renamed_file.odt" exists
And as "user1" the file "/SharedFolder/file.odt" does not exist
And as "user1" the file "/renamed_file.odt" does not exist