blob: 64ad99e20de28d150741f78ece0ce4512de4a72f (
plain)
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
|
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 "./../assets/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 "./../assets/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 "./../assets/template.ods"
And the WOPI HTTP status code should be "403"
And Collabora downloads the file
Then the file is equal to "./../assets/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 "./../assets/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 downoads the file and it is equal to "./../assets/template.odt"
And Collabora can not save the file with the content of "./../assets/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 "./../assets/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 downoads the file and it is equal to "./../assets/template.odt"
And Collabora can not save the file with the content of "./../assets/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 "./../assets/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 downoads the file and it is equal to "./../assets/template.odt"
And Collabora can not save the file with the content of "./../assets/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 "./../assets/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 downoads the file and it is equal to "./../assets/template.odt"
And Collabora can not save the file with the content of "./../assets/template.ods"
Scenario: Fetch checkFileInfo for public share link with download hidden
Given as user "user1"
And User "user1" uploads file "./../assets/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 "./../assets/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 "./../assets/template.odt"
And Collabora saved the file with the content of "./../assets/template.odt"
And Collabora downloads the file
Then the file is equal to "./../assets/template.odt"
Scenario: Save a file as the owner
Given as user "user1"
And User "user1" uploads file "./../assets/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 "./../assets/template.odt"
And checkFileInfo "UserCanWrite" is true
And Collabora saved the file with the content of "./../assets/template.odt"
And Collabora downloads the file
Then the file is equal to "./../assets/template.odt"
Scenario: Save a file as guest with write permissions
Given as user "user1"
And User "user1" uploads file "./../assets/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 "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 "./../assets/template.odt"
And Collabora saved the file with the content of "./../assets/template.ods"
And Collabora downloads the file
Then the file is equal to "./../assets/template.ods"
Scenario: Create different WOPI file ids
Given as user "user1"
And User "user1" uploads file "./../assets/template.odt" to "/file1.odt"
And User "user1" uploads file "./../assets/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 "./../assets/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 downoads the file and it is equal to "./../assets/template.odt"
And checkFileInfo "UserCanWrite" is false
And Collabora can not save the file with the content of "./../assets/template.ods"
Scenario: Open a shared file with write permissions
Given as user "user1"
And User "user1" uploads file "./../assets/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 downoads the file and it is equal to "./../assets/template.odt"
And Collabora can save the file with the content of "./../assets/template.ods"
Scenario: Open a reshared file with read permissions
Given user "user3" exists
When as user "user1"
And User "user1" uploads file "./../assets/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 "./../assets/template.odt"
And checkFileInfo "UserCanWrite" is false
And Collabora downoads the file and it is equal to "./../assets/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 "./../assets/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 "./../assets/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 downoads the file and it is equal to "./../assets/template.ods"
Scenario: Save as different user
Given as user "user1"
And User "user1" uploads file "./../assets/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 "./../assets/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 downoads the file and it is equal to "./../assets/template.ods"
|