@open-xchange/appsuite-codeceptjs 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +9 -0
- package/index.d.ts +598 -0
- package/package.json +4 -3
- package/global.d.ts +0 -3
package/index.d.ts
ADDED
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
*
|
|
5
|
+
* This code is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
+
*
|
|
18
|
+
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
declare module '@open-xchange/appsuite-codeceptjs' {
|
|
22
|
+
|
|
23
|
+
import Helper from '@codeceptjs/helper'
|
|
24
|
+
import { Page, Browser, BrowserContext, Request, Response } from 'playwright-core'
|
|
25
|
+
import * as OXPO from '@open-xchange/appsuite-codeceptjs-pageobjects'
|
|
26
|
+
|
|
27
|
+
export { recorder, event as codeceptEvents } from 'codeceptjs'
|
|
28
|
+
|
|
29
|
+
// util ---------------------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Converts the return type `Promise<void>` of all methods in `T` to `void`.
|
|
33
|
+
*
|
|
34
|
+
* @template T
|
|
35
|
+
* The interface with methods to be converted.
|
|
36
|
+
*/
|
|
37
|
+
export type SyncifyVoidMethods<T> = {
|
|
38
|
+
[K in keyof T]: T[K] extends (...args: infer A) => Promise<infer R> ? R extends void ? (...args: A) => void : T[K] : T[K]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
class PropagatedError extends Error {
|
|
42
|
+
constructor (error: Error)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type { PropagatedError }
|
|
46
|
+
|
|
47
|
+
export const util: {
|
|
48
|
+
getLoginTimeout (): number
|
|
49
|
+
getURLRoot (): string
|
|
50
|
+
getServerURL (): string
|
|
51
|
+
getJavascriptRoot (): string
|
|
52
|
+
userContextId (): number
|
|
53
|
+
admin (): string
|
|
54
|
+
mxDomain (): string
|
|
55
|
+
smtpServer (): string
|
|
56
|
+
imapServer (): string
|
|
57
|
+
getDefaultUserPassword (): string
|
|
58
|
+
PropagatedError: typeof PropagatedError
|
|
59
|
+
addJitter (id: number): number
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// config -------------------------------------------------------------------
|
|
63
|
+
|
|
64
|
+
export interface AppSuiteCodeceptConfig extends CodeceptJS.MainConfig {
|
|
65
|
+
helpers: NonNullable<CodeceptJS.MainConfig['helpers']>
|
|
66
|
+
include: NonNullable<CodeceptJS.MainConfig['include']>
|
|
67
|
+
plugins: NonNullable<CodeceptJS.MainConfig['plugins']>
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const config: AppSuiteCodeceptConfig
|
|
71
|
+
|
|
72
|
+
// contexts -----------------------------------------------------------------
|
|
73
|
+
|
|
74
|
+
export interface UserAttributes {
|
|
75
|
+
entries: Array<{ key: string; value: unknown }>
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface ContextData {
|
|
79
|
+
enabled: boolean
|
|
80
|
+
filestoreId: number
|
|
81
|
+
filestore_name: string
|
|
82
|
+
id: number
|
|
83
|
+
loginMappings: string[]
|
|
84
|
+
maxQuota: number
|
|
85
|
+
name: string
|
|
86
|
+
userAttributes: UserAttributes
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface AuthData {
|
|
90
|
+
login: string
|
|
91
|
+
password: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface ContextAdmin extends AuthData {
|
|
95
|
+
display_name: string
|
|
96
|
+
email1: string
|
|
97
|
+
given_name: string
|
|
98
|
+
name: string
|
|
99
|
+
primaryEmail: string
|
|
100
|
+
sur_name: string
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type ModuleAccess = Record<string, boolean>
|
|
104
|
+
|
|
105
|
+
class Context {
|
|
106
|
+
readonly id: number
|
|
107
|
+
readonly ctxdata: ContextData
|
|
108
|
+
readonly admin: ContextAdmin
|
|
109
|
+
readonly auth: AuthData
|
|
110
|
+
constructor (options: { ctxdata: ContextData; admin: ContextAdmin; auth: AuthData })
|
|
111
|
+
remove (): Promise<void>
|
|
112
|
+
hasConfig (key: string, value: unknown): Promise<void>
|
|
113
|
+
hasCapability (capability: string): Promise<void>
|
|
114
|
+
doesntHaveCapability (capability: string): Promise<void>
|
|
115
|
+
hasAccessCombination (accessCombinationName: string): Promise<void>
|
|
116
|
+
getModuleAccess (): Promise<ModuleAccess>
|
|
117
|
+
hasModuleAccess (moduleAccess: ModuleAccess): Promise<void>
|
|
118
|
+
hasQuota (maxQuota: number): Promise<void>
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export type { Context }
|
|
122
|
+
|
|
123
|
+
export interface Contexts extends ReadonlyArray<Context> {
|
|
124
|
+
create (ctx?: { filestoreId?: number; id?: string; maxQuota?: number }): Promise<Context>
|
|
125
|
+
reuse (ctx: Context, admin?: ContextAdmin, auth?: AuthData): Promise<Context>
|
|
126
|
+
removeAll (auth?: AuthData): Promise<void>
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// users --------------------------------------------------------------------
|
|
130
|
+
|
|
131
|
+
export interface UserData {
|
|
132
|
+
aliases: string[]
|
|
133
|
+
contextadmin: boolean
|
|
134
|
+
defaultSenderAddress: string
|
|
135
|
+
display_name: string
|
|
136
|
+
email1: string
|
|
137
|
+
given_name: string
|
|
138
|
+
id: number
|
|
139
|
+
imapLogin: string
|
|
140
|
+
imapPort: number
|
|
141
|
+
imapSchema: string
|
|
142
|
+
imapServer: string
|
|
143
|
+
imapServerString: string
|
|
144
|
+
language: string
|
|
145
|
+
mailenabled: boolean
|
|
146
|
+
name: string
|
|
147
|
+
password: string
|
|
148
|
+
passwordMech: string
|
|
149
|
+
password_expired: boolean
|
|
150
|
+
primaryEmail: string
|
|
151
|
+
smtpPort: number
|
|
152
|
+
smtpSchema: string
|
|
153
|
+
smtpServer: string
|
|
154
|
+
smtpServerString: string
|
|
155
|
+
sur_name: string
|
|
156
|
+
userAttributes: UserAttributes
|
|
157
|
+
convert_drive_user_folders: boolean
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
class User {
|
|
161
|
+
readonly userdata: UserData
|
|
162
|
+
readonly context: Context
|
|
163
|
+
constructor (options: { user: UserData, context: Context })
|
|
164
|
+
remove (): Promise<void>
|
|
165
|
+
hasConfig (key: string, value: unknown): Promise<void>
|
|
166
|
+
hasAlias (alias: string): Promise<void>
|
|
167
|
+
doesntHaveAlias (alias: string): Promise<void>
|
|
168
|
+
hasAccessCombination (accessCombinationName: string): Promise<void>
|
|
169
|
+
getModuleAccess (): Promise<ModuleAccess>
|
|
170
|
+
hasModuleAccess (moduleAccess: ModuleAccess): Promise<void>
|
|
171
|
+
hasCapability (capability: string): Promise<void>
|
|
172
|
+
doesntHaveCapability (capability: string): Promise<void>
|
|
173
|
+
login (): string
|
|
174
|
+
get <K extends keyof UserData> (param: K): UserData[K]
|
|
175
|
+
toJSON (): UserData & { context: ContextData & { admin: ContextAdmin; auth: AuthData } }
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export type { User }
|
|
179
|
+
|
|
180
|
+
export interface Users extends ReadonlyArray<User> {
|
|
181
|
+
getRandom (user?: Partial<UserData>): Partial<UserData>
|
|
182
|
+
create (user?: Partial<UserData>, context?: Context): Promise<User>
|
|
183
|
+
change (userdata: Partial<UserData>): Promise<void>
|
|
184
|
+
removeAll (): Promise<void>
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// shared accounts ----------------------------------------------------------
|
|
188
|
+
|
|
189
|
+
export interface SharedAccountData {
|
|
190
|
+
imapServer: string
|
|
191
|
+
smtpServer: string
|
|
192
|
+
language: string
|
|
193
|
+
mailenabled: number
|
|
194
|
+
name: string
|
|
195
|
+
display_name: string
|
|
196
|
+
imapLogin: string
|
|
197
|
+
primaryEmail: string
|
|
198
|
+
email1: string
|
|
199
|
+
timezone: string
|
|
200
|
+
password: string
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export type SharedAccountCapability = 'sendAs' | 'sendOnBehalf' | 'snippets' | 'writeSnippets' | 'manageSieve'
|
|
204
|
+
|
|
205
|
+
export interface SharedAccountModuleConfig {
|
|
206
|
+
permissionLevel: 'viewer' | 'editor' | 'author' | 'admin'
|
|
207
|
+
grantedCapability: SharedAccountCapability[]
|
|
208
|
+
deniedCapability: SharedAccountCapability[]
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
class SharedAccount {
|
|
212
|
+
readonly sharedAccountData: SharedAccountData
|
|
213
|
+
readonly context: Context
|
|
214
|
+
constructor (options: { sharedAccountData: SharedAccountData, context: Context })
|
|
215
|
+
createPermissions (options?: { users?: User[], groups?: User[], mail?: SharedAccountModuleConfig, calendar?: SharedAccountModuleConfig }): Promise<void>
|
|
216
|
+
getFullId (): string
|
|
217
|
+
getData (): Promise<SharedAccountData>
|
|
218
|
+
remove (): Promise<void>
|
|
219
|
+
toJSON (): SharedAccountData & { context: ContextData & { admin: ContextAdmin; auth: AuthData } }
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export type { SharedAccount }
|
|
223
|
+
|
|
224
|
+
export interface SharedAccounts extends ReadonlyArray<SharedAccount> {
|
|
225
|
+
getRandom (): SharedAccountData
|
|
226
|
+
create (sharedAccountData?: Partial<SharedAccountData>, ctx?: Context): Promise<SharedAccount>
|
|
227
|
+
getDefaultConfig (): { permissionLevel: string; grantedCapability: string[]; deniedCapability: string[] }
|
|
228
|
+
list (context: Context): Promise<SharedAccountData[]>
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// event --------------------------------------------------------------------
|
|
232
|
+
|
|
233
|
+
export interface AppSuiteCodeceptEventMap {
|
|
234
|
+
'provisioning.user.create': [user: UserData, context: Context]
|
|
235
|
+
'provisioning.user.created': [user: User]
|
|
236
|
+
'provisioning.user.removed': [user: User]
|
|
237
|
+
'provisioning.context.create': [context: ContextData, admin: ContextAdmin, auth: AuthData]
|
|
238
|
+
'provisioning.context.created': [context: Context]
|
|
239
|
+
'provisioning.context.removed': [context: Context]
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export const event: {
|
|
243
|
+
readonly provisioning: {
|
|
244
|
+
readonly user: {
|
|
245
|
+
readonly create: 'provisioning.user.create'
|
|
246
|
+
readonly created: 'provisioning.user.created'
|
|
247
|
+
readonly removed: 'provisioning.user.removed'
|
|
248
|
+
}
|
|
249
|
+
readonly context: {
|
|
250
|
+
readonly create: 'provisioning.context.create'
|
|
251
|
+
readonly created: 'provisioning.context.created'
|
|
252
|
+
readonly removed: 'provisioning.context.removed'
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
dispatcher: NodeJS.EventEmitter<AppSuiteCodeceptEventMap>
|
|
256
|
+
emit <K extends keyof AppSuiteCodeceptEventMap> (event: K, ...params: AppSuiteCodeceptEventMap[K]): void
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// helper -------------------------------------------------------------------
|
|
260
|
+
|
|
261
|
+
export interface UserOptions {
|
|
262
|
+
/**
|
|
263
|
+
* The user account to be used. Default is the first created user.
|
|
264
|
+
* @default users[0]
|
|
265
|
+
*/
|
|
266
|
+
user?: User
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export type MailAddress = [name: string, address: string]
|
|
270
|
+
|
|
271
|
+
export interface MailAttachment {
|
|
272
|
+
id?: string
|
|
273
|
+
content_type: string
|
|
274
|
+
content?: string
|
|
275
|
+
filename?: string
|
|
276
|
+
size?: number
|
|
277
|
+
disp?: 'inline' | 'attachment' | 'alternative'
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export interface MailSecurity {
|
|
281
|
+
encrypt?: boolean
|
|
282
|
+
sign?: boolean
|
|
283
|
+
type?: 'pgp' | 'smime'
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface HaveMailData {
|
|
287
|
+
folder?: string
|
|
288
|
+
from: MailAddress[]
|
|
289
|
+
to: MailAddress[]
|
|
290
|
+
subject?: string
|
|
291
|
+
sendtype: number
|
|
292
|
+
attachments?: MailAttachment[]
|
|
293
|
+
security?: MailSecurity
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export interface HaveMailFromFile {
|
|
297
|
+
folder?: string
|
|
298
|
+
path: string
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface GrabDefaultFolderOptions extends UserOptions {
|
|
302
|
+
type?: string
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface HaveFileData {
|
|
306
|
+
filename: string
|
|
307
|
+
contents: BlobPart
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export interface HaveFileOptions extends UserOptions {
|
|
311
|
+
cryptoAction?: 'encrypt'
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export interface AppSuiteHelper extends Helper {
|
|
315
|
+
waitForDownload (locator: string, filename: string, referenceFilePath?: string): Promise<void>
|
|
316
|
+
grabAxeReport (options?: { disableRules?: string | string[]; exclude?: string | string[]; include?: string | string[] }): Promise<object>
|
|
317
|
+
selectFolder (id: string, context?: string): Promise<void>
|
|
318
|
+
throttleNetwork (networkConfig: 'OFFLINE' | 'GPRS' | '2G' | '3G' | '4G' | 'DSL' | 'ONLINE'): Promise<void>
|
|
319
|
+
haveSetting (settings: Record<string, unknown>, options?: UserOptions): Promise<void>
|
|
320
|
+
haveSetting (key: string, value: unknown, options?: UserOptions): Promise<void>
|
|
321
|
+
/**
|
|
322
|
+
* Changes a configuration item of a user account during a test.
|
|
323
|
+
*
|
|
324
|
+
* Use this method inside test scenarios instead of calling `await
|
|
325
|
+
* user.hasConfig()` directly to make this call part of the recorder queue,
|
|
326
|
+
* instead of executing it immediately during test step registration.
|
|
327
|
+
*
|
|
328
|
+
* @param key
|
|
329
|
+
* The configuration key.
|
|
330
|
+
*
|
|
331
|
+
* @param value
|
|
332
|
+
* The new configuration value.
|
|
333
|
+
*
|
|
334
|
+
* @param options
|
|
335
|
+
* Optional parameters.
|
|
336
|
+
*/
|
|
337
|
+
haveConfig (key: string, value: unknown, options?: UserOptions): Promise<void>
|
|
338
|
+
/**
|
|
339
|
+
* Adds a capability to a user account during a test.
|
|
340
|
+
*
|
|
341
|
+
* Use this method inside test scenarios instead of calling `await
|
|
342
|
+
* user.hasCapability()` directly to make this call part of the recorder
|
|
343
|
+
* queue, instead of executing it immediately during test step registration.
|
|
344
|
+
*
|
|
345
|
+
* @param capability
|
|
346
|
+
* The capability to be added to the user account.
|
|
347
|
+
*
|
|
348
|
+
* @param options
|
|
349
|
+
* Optional parameters.
|
|
350
|
+
*/
|
|
351
|
+
haveCapability (capability: string, options?: UserOptions): Promise<void>
|
|
352
|
+
/**
|
|
353
|
+
* Removes a capability from a user account during a test.
|
|
354
|
+
*
|
|
355
|
+
* Use this method inside test scenarios instead of calling `await
|
|
356
|
+
* user.doesntHaveCapability()` directly to make this call part of the
|
|
357
|
+
* recorder queue, instead of executing it immediately during test step
|
|
358
|
+
* registration.
|
|
359
|
+
*
|
|
360
|
+
* @param capability
|
|
361
|
+
* The capability to be removed from the user account.
|
|
362
|
+
*
|
|
363
|
+
* @param options
|
|
364
|
+
* Optional parameters.
|
|
365
|
+
*/
|
|
366
|
+
dontHaveCapability (capability: string, options?: UserOptions): Promise<void>
|
|
367
|
+
/**
|
|
368
|
+
* Changes the access combination of a user account during a test.
|
|
369
|
+
*
|
|
370
|
+
* Use this method inside test scenarios instead of calling `await
|
|
371
|
+
* user.hasAccessCombination()` directly to make this call part of the
|
|
372
|
+
* recorder queue, instead of executing it immediately during test step
|
|
373
|
+
* registration.
|
|
374
|
+
*
|
|
375
|
+
* @param accessCombination
|
|
376
|
+
* The access combination to be set at the user account.
|
|
377
|
+
*
|
|
378
|
+
* @param options
|
|
379
|
+
* Optional parameters.
|
|
380
|
+
*/
|
|
381
|
+
haveAccessCombination (accessCombination: string, options?: UserOptions): Promise<void>
|
|
382
|
+
/**
|
|
383
|
+
* Changes the module access flags of a user account during a test.
|
|
384
|
+
*
|
|
385
|
+
* Use this method inside test scenarios instead of calling `await
|
|
386
|
+
* user.hasModuleAccess()` directly to make this call part of the recorder
|
|
387
|
+
* queue, instead of executing it immediately during test step
|
|
388
|
+
* registration.
|
|
389
|
+
*
|
|
390
|
+
* @param moduleAccess
|
|
391
|
+
* The module access flags to be set at the user account.
|
|
392
|
+
*
|
|
393
|
+
* @param options
|
|
394
|
+
* Optional parameters.
|
|
395
|
+
*/
|
|
396
|
+
haveModuleAccess (moduleAccess: ModuleAccess, options?: UserOptions): Promise<void>
|
|
397
|
+
haveSnippet (snippet: object /* TODO */, options?: UserOptions): Promise<void>
|
|
398
|
+
haveMail (data: HaveMailData | HaveMailFromFile, options?: UserOptions): Promise<void>
|
|
399
|
+
haveMails (iterable: Iterable<HaveMailData | HaveMailFromFile>, options?: UserOptions): Promise<void>
|
|
400
|
+
/**
|
|
401
|
+
* Adds an alias email address to a user account during a test.
|
|
402
|
+
*
|
|
403
|
+
* Use this method inside test scenarios instead of calling `await
|
|
404
|
+
* user.hasAlias()` directly to make this call part of the recorder queue,
|
|
405
|
+
* instead of executing it immediately during test step registration.
|
|
406
|
+
*
|
|
407
|
+
* @param alias
|
|
408
|
+
* The alias email address to be added to the user account.
|
|
409
|
+
*
|
|
410
|
+
* @param options
|
|
411
|
+
* Optional parameters.
|
|
412
|
+
*/
|
|
413
|
+
haveAnAlias (alias: string, options?: UserOptions): Promise<void>
|
|
414
|
+
/**
|
|
415
|
+
* Removes an alias email address from a user account during a test.
|
|
416
|
+
*
|
|
417
|
+
* Use this method inside test scenarios instead of calling `await
|
|
418
|
+
* user.doesntHaveAlias()` directly to make this call part of the recorder
|
|
419
|
+
* queue, instead of executing it immediately during test step registration.
|
|
420
|
+
*
|
|
421
|
+
* @param alias
|
|
422
|
+
* The alias email address to be removed from the user account.
|
|
423
|
+
*
|
|
424
|
+
* @param options
|
|
425
|
+
* Optional parameters.
|
|
426
|
+
*/
|
|
427
|
+
dontHaveAlias (alias: string, options?: UserOptions): Promise<void>
|
|
428
|
+
haveMailFilterRule (rule: object /* TODO */, options?: UserOptions): Promise<void>
|
|
429
|
+
haveFolder (folder: { title: string; module: string; parent: string; permissions?: string[]; subscribed?: number }, options?: UserOptions): Promise<string>
|
|
430
|
+
haveContact (contact: object /* TODO */, options?: UserOptions): Promise<object> /* TODO */
|
|
431
|
+
grabDefaultFolder (module: string, options?: GrabDefaultFolderOptions): Promise<string>
|
|
432
|
+
/**
|
|
433
|
+
* Uploads a file to a specified folder.
|
|
434
|
+
* @param folderId - The ID of the folder where the file will be uploaded.
|
|
435
|
+
* @param file - The path to the file or an object containing the file information.
|
|
436
|
+
* @param options - Additional options for the file upload.
|
|
437
|
+
* @returns - The uploaded file data.
|
|
438
|
+
*/
|
|
439
|
+
haveFile(folderId: string, file: string | HaveFileData, options?: HaveFileOptions): Promise<{ folder_id: string; id: string }>
|
|
440
|
+
haveTask (task: object /* TODO */, options?: UserOptions): Promise<object> /* TODO */
|
|
441
|
+
/**
|
|
442
|
+
* Uploads an attachment to the specified module and object.
|
|
443
|
+
* @param module - The module to attach the file to.
|
|
444
|
+
* @param obj - The object to attach the file to.
|
|
445
|
+
* @param file - The file to be attached.
|
|
446
|
+
* @param options - The options for creating the HTTP client.
|
|
447
|
+
*/
|
|
448
|
+
haveAttachment (module: 'calendar' | 'chronos' | 'contacts' | 'drive' | 'files' | 'infostore' | 'tasks', obj: object /** TODO */, file: string, options?: UserOptions): Promise<object> /* TODO */
|
|
449
|
+
haveAppointment (appointment: object /* TODO */, options?: UserOptions): Promise<object> /* TODO */
|
|
450
|
+
importAppointment (data: { sourcePath: string; folder?: string }, options?: UserOptions): Promise<object> /* TODO */
|
|
451
|
+
haveResource (data: object /* TODO */, options?: UserOptions): Promise<string>
|
|
452
|
+
dontHaveResource (pattern: object /* TODO */, options?: UserOptions): Promise<Array<{ id: string; pattern: object }>>
|
|
453
|
+
haveGroup (group: object /* TODO */, options?: UserOptions): Promise<object> /* TODO */
|
|
454
|
+
dontHaveGroup (name: string, options?: UserOptions): Promise<Array<{ id: string; name: string }>>
|
|
455
|
+
haveLockedFile (data: object /* TODO */, options?: UserOptions): Promise<object> /* TODO */
|
|
456
|
+
setMailCategories (data: { mailId: string; folder: string; categories: string[] }, options?: UserOptions): Promise<object> /* TODO */
|
|
457
|
+
pressKeys (text: string): Promise<void>
|
|
458
|
+
/**
|
|
459
|
+
* @param options
|
|
460
|
+
* @param [options.user] a user object as returned by provisioning helper, default is the "first" user
|
|
461
|
+
* @param [options.additionalAccount] an additional user that will be provisioned as the external account
|
|
462
|
+
* @param [options.extension] optional extension added to the mail address ("ext" will be translated to: $user.primary+ext@mailDomain)
|
|
463
|
+
* @param [options.name] name of the account
|
|
464
|
+
* @param [options.transport_auth] transport authentication, default: 'none'
|
|
465
|
+
*/
|
|
466
|
+
haveMailAccount (options?: { user?: object, additionalAccount?: object, extension?: string, name?: string, transport_auth?: string }): Promise<object> /* TODO */
|
|
467
|
+
waitForSetting (obj: object, timeout?: number, options?: UserOptions): Promise<void>
|
|
468
|
+
waitForCapability (capability: string, timeout?: number, options?: UserOptions & { shouldBe?: boolean }): Promise<void>
|
|
469
|
+
copyToClipboard (): Promise<void>
|
|
470
|
+
getClipboardContent (): Promise<string>
|
|
471
|
+
createGenericFile (filename: string, size: number): Promise<void>
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
export interface AppSuiteHelpers {
|
|
475
|
+
Playwright: CodeceptJS.Playwright
|
|
476
|
+
AppSuite: AppSuiteHelper
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// actor --------------------------------------------------------------------
|
|
480
|
+
|
|
481
|
+
export interface LoginOptions extends UserOptions {
|
|
482
|
+
wait?: boolean
|
|
483
|
+
isDeepLink?: boolean
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export interface AppSuiteActor {
|
|
487
|
+
amOnLoginPage (): void
|
|
488
|
+
openApp (appName: CodeceptJS.LocatorOrString): void
|
|
489
|
+
waitForApp (): void
|
|
490
|
+
/**
|
|
491
|
+
* This simplifies the input of mail addresses into input fields.
|
|
492
|
+
* There must be an array of users defined in the AppSuite helper configuration.
|
|
493
|
+
* If you want to fill in a mailaddress of such a user you can simply use this function.
|
|
494
|
+
*
|
|
495
|
+
* @param locator - the selector of an editable field
|
|
496
|
+
* @param userIndex - the users position in the users array provided via helper config
|
|
497
|
+
*/
|
|
498
|
+
insertMailaddress (locator: CodeceptJS.LocatorOrString, userIndex: number): void
|
|
499
|
+
/**
|
|
500
|
+
* Logs in the user with the specified URL parameters and options.
|
|
501
|
+
* If the URL parameters are an object, it will be converted to an empty array.
|
|
502
|
+
* The options parameter is an object that can contain a 'user' property.
|
|
503
|
+
* If the 'user' property is not provided, the first user from the 'users' container will be used.
|
|
504
|
+
* The login process includes making an API request to the login endpoint with the user's credentials.
|
|
505
|
+
* After successful login, the page will be navigated to the specified URL with the URL parameters.
|
|
506
|
+
* If the 'isDeepLink' option is true, the URL will be constructed with a '#' prefix.
|
|
507
|
+
* The login process also includes waiting for the page to load and checking for the presence of the app.
|
|
508
|
+
* @param urlParams - The URL parameters as an array or object.
|
|
509
|
+
* @param options - The login options.
|
|
510
|
+
*/
|
|
511
|
+
login(urlParams: string | string[], options?: LoginOptions): void
|
|
512
|
+
login(options?: LoginOptions): void
|
|
513
|
+
logout(): void
|
|
514
|
+
waitForNetworkTraffic (): void
|
|
515
|
+
/**
|
|
516
|
+
* Waits for the specified element to receive focus.
|
|
517
|
+
* @param selector - The locator of the element. Only accepts css selectors.
|
|
518
|
+
*/
|
|
519
|
+
waitForFocus (selector: string): void
|
|
520
|
+
triggerRefresh (): void
|
|
521
|
+
grabBackgroundImageFrom (locator: CodeceptJS.LocatorOrString): Promise<string>
|
|
522
|
+
clickDropdown (text: string): void
|
|
523
|
+
clickToolbar (selector: string, timeout?: number): void
|
|
524
|
+
clickPrimary (text: string): void
|
|
525
|
+
openFolderMenu (folderName: string): void
|
|
526
|
+
changeTheme (options: { theme: string }): void
|
|
527
|
+
/**
|
|
528
|
+
* Selects the text in a text field or contenteditable element from cursor position to beginning of line.
|
|
529
|
+
*/
|
|
530
|
+
selectLine (): void
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export const actor: CodeceptJS.actor
|
|
534
|
+
|
|
535
|
+
// augment global CodeceptJS interfaces -------------------------------------
|
|
536
|
+
|
|
537
|
+
global {
|
|
538
|
+
namespace CodeceptJS {
|
|
539
|
+
|
|
540
|
+
// Playwright interface fixes
|
|
541
|
+
interface Playwright {
|
|
542
|
+
/** The browser object. */
|
|
543
|
+
readonly browser: Browser
|
|
544
|
+
/** The browser context object. */
|
|
545
|
+
readonly browserContext: BrowserContext
|
|
546
|
+
/** The page object for the current (active) page in the browser. */
|
|
547
|
+
readonly page: Page
|
|
548
|
+
|
|
549
|
+
// fix for non-generic `any` signature
|
|
550
|
+
usePlaywrightTo(description: string, callback: (playwright: Playwright) => void | Promise<void>): void
|
|
551
|
+
usePlaywrightTo<R>(description: string, callback: (playwright: Playwright) => R | Promise<R>): Promise<R>
|
|
552
|
+
|
|
553
|
+
// fix for non-generic `any` signature
|
|
554
|
+
executeScript(callback: (this: void) => void | Promise<void>): void
|
|
555
|
+
executeScript<T>(callback: (this: void, arg: T) => void | Promise<void>, arg: T): void
|
|
556
|
+
executeScript<R>(callback: (this: void) => R | Promise<R>): Promise<R>
|
|
557
|
+
executeScript<T, R>(callback: (this: void, arg: T) => R | Promise<R>, arg: T): Promise<R>
|
|
558
|
+
|
|
559
|
+
// fix for `any` callback signature
|
|
560
|
+
waitForRequest(urlOrPredicate: string | ((request: Request) => boolean), sec?: number): void
|
|
561
|
+
waitForResponse(urlOrPredicate: string | ((response: Response) => boolean), sec?: number): void
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// helpers and actor methods for `I` object added by this plugin
|
|
565
|
+
interface Methods extends
|
|
566
|
+
SyncifyVoidMethods<Playwright>,
|
|
567
|
+
SyncifyVoidMethods<AppSuiteHelper>,
|
|
568
|
+
AppSuiteActor { }
|
|
569
|
+
|
|
570
|
+
// CodeceptJS does not add `Methods` to `I` by itself
|
|
571
|
+
interface I extends Methods { }
|
|
572
|
+
|
|
573
|
+
// additional fragments and page objects
|
|
574
|
+
interface SupportObject {
|
|
575
|
+
autocomplete: OXPO.ContactAutoCompleteFragment
|
|
576
|
+
calendar: OXPO.CalendarPageObject
|
|
577
|
+
contactpicker: OXPO.ContactPickerFragment
|
|
578
|
+
contacts: OXPO.ContactsPageObject
|
|
579
|
+
contexts: Contexts
|
|
580
|
+
dialogs: OXPO.DialogsFragment
|
|
581
|
+
drive: OXPO.DrivePageObject
|
|
582
|
+
mail: OXPO.MailPageObject
|
|
583
|
+
mailfilter: OXPO.SettingsMailFilterFragment
|
|
584
|
+
mobileCalendar: OXPO.MobileCalendarPageObject
|
|
585
|
+
mobileContacts: OXPO.MobileContactsPageObject
|
|
586
|
+
mobileMail: OXPO.MobileMailPageFragment
|
|
587
|
+
search: OXPO.SearchFragment
|
|
588
|
+
settings: OXPO.SettingsFragment
|
|
589
|
+
sharedaccounts: SharedAccounts
|
|
590
|
+
tasks: OXPO.TasksPageObject
|
|
591
|
+
tinymce: OXPO.TinyMceFragment
|
|
592
|
+
topbar: OXPO.TopBarFragment
|
|
593
|
+
users: Users
|
|
594
|
+
viewer: OXPO.ViewerFragment
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xchange/appsuite-codeceptjs",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "OX App Suite CodeceptJS Configuration and Helpers",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
6
7
|
"bin": {
|
|
7
8
|
"e2e-rerun": "./customRerun.js"
|
|
8
9
|
},
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
"@axe-core/playwright": "^4.11.0",
|
|
18
19
|
"@codeceptjs/helper": "^2.0.4",
|
|
19
20
|
"@influxdata/influxdb-client": "^1.35.0",
|
|
20
|
-
"@open-xchange/appsuite-codeceptjs-pageobjects": "^1.1.
|
|
21
|
+
"@open-xchange/appsuite-codeceptjs-pageobjects": "^1.1.1",
|
|
21
22
|
"@playwright/test": "1.58.2",
|
|
22
23
|
"allure-codeceptjs": "2.15.1",
|
|
23
24
|
"chai": "^6.2.1",
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
"playwright-core": "1.58.2",
|
|
35
36
|
"short-uuid": "^6.0.3",
|
|
36
37
|
"@open-xchange/codecept-horizontal-scaler": "0.1.14",
|
|
37
|
-
"@open-xchange/soap-client": "0.0.
|
|
38
|
+
"@open-xchange/soap-client": "0.0.12"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@types/node": "^24.10.3",
|
package/global.d.ts
DELETED