-
Notifications
You must be signed in to change notification settings - Fork 203
Expand file tree
/
Copy pathurlJourneys.spec.ts
More file actions
145 lines (139 loc) · 5.56 KB
/
urlJourneys.spec.ts
File metadata and controls
145 lines (139 loc) · 5.56 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
// To run this feature we need to run the external app-provider service along with wopi, OnlyOffice, Collabora services
// This is a minimal test for the integration of ocis with different online office suites like Collabora and OnlyOffice
// Check that the file can be opened in collabora or onlyoffice using the url. https://github.com/owncloud/web/issues/9897
import { test } from '@playwright/test'
import { config } from '../../../e2e/config.js'
import { ActorsEnvironment, UsersEnvironment } from '../../../e2e/support/environment'
import { setAccessAndRefreshToken } from '../../helpers/setAccessAndRefreshToken'
import * as api from '../../steps/api/api'
import * as ui from '../../steps/ui/index'
test.describe('url stability for mobile and desktop client', { tag: '@predefined-users' }, () => {
let actorsEnvironment
const usersEnvironment = new UsersEnvironment()
test.beforeEach(async ({ browser }) => {
actorsEnvironment = new ActorsEnvironment({
context: {
acceptDownloads: config.acceptDownloads,
reportDir: config.reportDir,
tracingReportDir: config.tracingReportDir,
reportHar: config.reportHar,
reportTracing: config.reportTracing,
reportVideo: config.reportVideo,
failOnUncaughtConsoleError: config.failOnUncaughtConsoleError
},
browser: browser
})
await setAccessAndRefreshToken(usersEnvironment)
// Given "Admin" creates following users using API
// | id |
// | Alice |
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Alice' })
// And "Alice" logs in
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
// And "Alice" creates the following files into personal space using API
// | pathToFile | content |
// | OpenDocument.odt | OpenDocument Content |
await api.userHasCreatedFile({
usersEnvironment,
stepUser: 'Alice',
filename: 'OpenDocument.odt',
content: 'OpenDocument Content'
})
// And "Alice" creates the following resources
// | resource | type | content |
// | MicrosoftWord.docx | Microsoft Word | Microsoft Word Content |
await ui.userCreatesResources({
actorsEnvironment,
stepUser: 'Alice',
resource: 'MicrosoftWord.docx',
type: 'Microsoft Word',
content: 'Microsoft Word Content'
})
// And for "Alice" file "MicrosoftWord.docx" should not be locked
await ui.resourceShouldNotBeLocked({
actorsEnvironment,
stepUser: 'Alice',
resource: 'MicrosoftWord.docx'
})
// And "Alice" opens the "files" app
await ui.userOpensApplication({ actorsEnvironment, stepUser: 'Alice', name: 'files' })
})
test.afterEach(async () => {
// clean up users
await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Alice' })
})
test('open office suite files with Collabora and onlyOffice', async () => {
// desktop feature
// When "Alice" opens the file "OpenDocument.odt" of space "personal" in Collabora through the URL for desktop client
await ui.userOpensResourceViaUrl({
actorsEnvironment,
usersEnvironment,
stepUser: 'Alice',
resource: 'OpenDocument.odt',
space: 'personal',
editorName: 'Collabora',
client: 'desktop'
})
// Then "Alice" should see the content "OpenDocument Content" in editor "Collabora"
await ui.userShouldSeeContentInEditor({
actorsEnvironment,
stepUser: 'Alice',
expectedContent: 'OpenDocument Content',
editor: 'Collabora'
})
// When "Alice" opens the file "MicrosoftWord.docx" of space "personal" in OnlyOffice through the URL for desktop client
await ui.userOpensResourceViaUrl({
actorsEnvironment,
usersEnvironment,
stepUser: 'Alice',
resource: 'MicrosoftWord.docx',
space: 'personal',
editorName: 'OnlyOffice',
client: 'desktop'
})
// Then "Alice" should see the content "Microsoft Word Content" in editor "OnlyOffice"
await ui.userShouldSeeContentInEditor({
actorsEnvironment,
stepUser: 'Alice',
expectedContent: 'Microsoft Word Content',
editor: 'OnlyOffice'
})
// mobile feature
// When "Alice" opens the file "OpenDocument.odt" of space "personal" in Collabora through the URL for mobile client
await ui.userOpensResourceViaUrl({
actorsEnvironment,
usersEnvironment,
stepUser: 'Alice',
resource: 'OpenDocument.odt',
space: 'personal',
editorName: 'Collabora',
client: 'mobile'
})
// Then "Alice" should see the content "OpenDocument Content" in editor "Collabora"
await ui.userShouldSeeContentInEditor({
actorsEnvironment,
stepUser: 'Alice',
expectedContent: 'OpenDocument Content',
editor: 'Collabora'
})
// When "Alice" opens the file "MicrosoftWord.docx" of space "personal" in OnlyOffice through the URL for mobile client
await ui.userOpensResourceViaUrl({
actorsEnvironment,
usersEnvironment,
stepUser: 'Alice',
resource: 'MicrosoftWord.docx',
space: 'personal',
editorName: 'OnlyOffice',
client: 'mobile'
})
// Then "Alice" should see the content "Microsoft Word Content" in editor "OnlyOffice"
await ui.userShouldSeeContentInEditor({
actorsEnvironment,
stepUser: 'Alice',
expectedContent: 'Microsoft Word Content',
editor: 'OnlyOffice'
})
// And "Alice" logs out
await ui.logOutUser({ actorsEnvironment, stepUser: 'Alice' })
})
})