@open-xchange/appsuite-codeceptjs 0.8.0 → 0.8.1
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/CHANGELOG.md +11 -0
- package/index.d.ts +33 -2
- package/index.js +1 -1
- package/package.json +5 -5
- package/src/contexts/contexts.js +2 -1
- package/src/contexts/reseller.js +1 -0
- package/src/event.js +6 -1
- package/src/sharedaccounts/sharedaccounts.js +8 -3
- package/src/users/reseller.js +3 -3
- package/src/users/users.js +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.8.1] - 2026-03-26
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- TypeScript type fixes and additions (chai globals)
|
|
12
|
+
- Emit events for shared accounts
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Include TypeScript test files in build
|
|
17
|
+
|
|
7
18
|
## [0.8.0] - 2026-03-15
|
|
8
19
|
|
|
9
20
|
### Changed
|
package/index.d.ts
CHANGED
|
@@ -26,6 +26,20 @@ declare module '@open-xchange/appsuite-codeceptjs' {
|
|
|
26
26
|
|
|
27
27
|
export { recorder, event as codeceptEvents } from 'codeceptjs'
|
|
28
28
|
|
|
29
|
+
// chai ---------------------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
// from src/chai.js
|
|
32
|
+
global {
|
|
33
|
+
const assert: Chai.AssertStatic
|
|
34
|
+
const expect: Chai.ExpectStatic
|
|
35
|
+
|
|
36
|
+
namespace Chai {
|
|
37
|
+
interface Assertion {
|
|
38
|
+
accessible: Assertion
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
29
43
|
// util ---------------------------------------------------------------------
|
|
30
44
|
|
|
31
45
|
/**
|
|
@@ -237,6 +251,9 @@ declare module '@open-xchange/appsuite-codeceptjs' {
|
|
|
237
251
|
'provisioning.context.create': [context: ContextData, admin: ContextAdmin, auth: AuthData]
|
|
238
252
|
'provisioning.context.created': [context: Context]
|
|
239
253
|
'provisioning.context.removed': [context: Context]
|
|
254
|
+
'provisioning.sharedaccount.create': [sharedAccount: SharedAccountData, context: Context]
|
|
255
|
+
'provisioning.sharedaccount.created': [sharedAccount: SharedAccount]
|
|
256
|
+
'provisioning.sharedaccount.removed': [sharedAccount: SharedAccount]
|
|
240
257
|
}
|
|
241
258
|
|
|
242
259
|
export const event: {
|
|
@@ -251,6 +268,11 @@ declare module '@open-xchange/appsuite-codeceptjs' {
|
|
|
251
268
|
readonly created: 'provisioning.context.created'
|
|
252
269
|
readonly removed: 'provisioning.context.removed'
|
|
253
270
|
}
|
|
271
|
+
readonly sharedaccount: {
|
|
272
|
+
readonly create: 'provisioning.sharedaccount.create'
|
|
273
|
+
readonly created: 'provisioning.sharedaccount.created'
|
|
274
|
+
readonly removed: 'provisioning.sharedaccount.removed'
|
|
275
|
+
}
|
|
254
276
|
}
|
|
255
277
|
dispatcher: NodeJS.EventEmitter<AppSuiteCodeceptEventMap>
|
|
256
278
|
emit <K extends keyof AppSuiteCodeceptEventMap> (event: K, ...params: AppSuiteCodeceptEventMap[K]): void
|
|
@@ -316,8 +338,7 @@ declare module '@open-xchange/appsuite-codeceptjs' {
|
|
|
316
338
|
grabAxeReport (options?: { disableRules?: string | string[]; exclude?: string | string[]; include?: string | string[] }): Promise<object>
|
|
317
339
|
selectFolder (id: string, context?: string): Promise<void>
|
|
318
340
|
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>
|
|
341
|
+
haveSetting (...args: [settings: Record<string, unknown>, options?: UserOptions] | [key: string, value: unknown, options?: UserOptions]): Promise<void>
|
|
321
342
|
/**
|
|
322
343
|
* Changes a configuration item of a user account during a test.
|
|
323
344
|
*
|
|
@@ -593,6 +614,16 @@ declare module '@open-xchange/appsuite-codeceptjs' {
|
|
|
593
614
|
users: Users
|
|
594
615
|
viewer: OXPO.ViewerFragment
|
|
595
616
|
}
|
|
617
|
+
|
|
618
|
+
interface Suite {
|
|
619
|
+
suites: Suite[]
|
|
620
|
+
tests: Test[]
|
|
621
|
+
eachTest (fn: (test: Test) => void): this
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
interface Test {
|
|
625
|
+
parent: Suite
|
|
626
|
+
}
|
|
596
627
|
}
|
|
597
628
|
}
|
|
598
629
|
}
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xchange/appsuite-codeceptjs",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "OX App Suite CodeceptJS Configuration and Helpers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@playwright/test": "1.58.2",
|
|
23
23
|
"allure-codeceptjs": "2.15.1",
|
|
24
24
|
"chai": "^6.2.2",
|
|
25
|
-
"codeceptjs": "3.7.
|
|
25
|
+
"codeceptjs": "3.7.7",
|
|
26
26
|
"mocha": "^11.7.5",
|
|
27
27
|
"mocha-junit-reporter": "^2.2.1",
|
|
28
28
|
"mocha-multi": "^1.1.7",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"p-retry": "^7.1.1",
|
|
32
32
|
"playwright-core": "1.58.2",
|
|
33
33
|
"short-uuid": "^6.0.3",
|
|
34
|
-
"@open-xchange/
|
|
35
|
-
"@open-xchange/
|
|
34
|
+
"@open-xchange/soap-client": "0.1.0",
|
|
35
|
+
"@open-xchange/codecept-horizontal-scaler": "0.1.15"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^25.5.0",
|
|
39
39
|
"ts-node": "^10.9.2",
|
|
40
|
-
"typescript": "^
|
|
40
|
+
"typescript": "^6.0.0",
|
|
41
41
|
"@open-xchange/lint": "0.3.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
package/src/contexts/contexts.js
CHANGED
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
const created = []
|
|
22
21
|
const users = require('../users/users')()
|
|
23
22
|
const util = require('../util')
|
|
24
23
|
const event = require('../event')
|
|
@@ -26,6 +25,8 @@ const { contextService, getFilestorageId } = require('@open-xchange/soap-client/
|
|
|
26
25
|
const crypto = require('node:crypto')
|
|
27
26
|
const codecept = require('codeceptjs')
|
|
28
27
|
|
|
28
|
+
const created = []
|
|
29
|
+
|
|
29
30
|
class Context {
|
|
30
31
|
constructor ({ ctxdata, admin, auth }) {
|
|
31
32
|
this.id = ctxdata.id
|
package/src/contexts/reseller.js
CHANGED
|
@@ -22,6 +22,7 @@ const event = require('../event')
|
|
|
22
22
|
const users = require('../users/reseller')()
|
|
23
23
|
const util = require('../util')
|
|
24
24
|
const { resellerContextService, resellerUserService } = require('@open-xchange/soap-client/reseller')
|
|
25
|
+
|
|
25
26
|
const contexts = []
|
|
26
27
|
const created = []
|
|
27
28
|
|
package/src/event.js
CHANGED
|
@@ -36,7 +36,12 @@ module.exports = {
|
|
|
36
36
|
create: 'provisioning.context.create',
|
|
37
37
|
created: 'provisioning.context.created',
|
|
38
38
|
removed: 'provisioning.context.removed'
|
|
39
|
-
}
|
|
39
|
+
},
|
|
40
|
+
sharedaccount: {
|
|
41
|
+
create: 'provisioning.sharedaccount.create',
|
|
42
|
+
created: 'provisioning.sharedaccount.created',
|
|
43
|
+
removed: 'provisioning.sharedaccount.removed'
|
|
44
|
+
},
|
|
40
45
|
},
|
|
41
46
|
emit (event, param) {
|
|
42
47
|
let msg = `Emitted | ${event}`
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
const short = require('short-uuid')
|
|
22
22
|
const { sharedAccountService } = require('@open-xchange/soap-client/common')
|
|
23
|
+
const event = require('../event')
|
|
23
24
|
const util = require('../util')
|
|
24
25
|
|
|
25
26
|
const sharedAccounts = []
|
|
@@ -77,6 +78,7 @@ class SharedAccount {
|
|
|
77
78
|
*/
|
|
78
79
|
static async create (sharedAccountData, ctx = {}) {
|
|
79
80
|
sharedAccountData = { ...this.getRandom(), ...sharedAccountData }
|
|
81
|
+
event.emit(event.provisioning.sharedaccount.create, sharedAccountData, ctx)
|
|
80
82
|
|
|
81
83
|
const { contexts } = inject()
|
|
82
84
|
let sharedAccountContext
|
|
@@ -91,6 +93,7 @@ class SharedAccount {
|
|
|
91
93
|
const data = await sharedAccountService.create(sharedAccountContext, sharedAccountData)
|
|
92
94
|
const sharedAccount = new SharedAccount({ sharedAccountData: data, context: sharedAccountContext })
|
|
93
95
|
sharedAccounts.push(sharedAccount)
|
|
96
|
+
event.emit(event.provisioning.sharedaccount.created, sharedAccount)
|
|
94
97
|
return sharedAccount
|
|
95
98
|
}
|
|
96
99
|
|
|
@@ -155,10 +158,12 @@ class SharedAccount {
|
|
|
155
158
|
* @returns {Promise<void>}
|
|
156
159
|
*/
|
|
157
160
|
async remove () {
|
|
161
|
+
await sharedAccountService.remove(this.context, this.sharedAccountData)
|
|
158
162
|
const index = sharedAccounts.indexOf(this)
|
|
159
|
-
if (index
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
if (index >= 0) {
|
|
164
|
+
sharedAccounts.splice(index, 1)
|
|
165
|
+
event.emit(event.provisioning.sharedaccount.removed, this)
|
|
166
|
+
}
|
|
162
167
|
}
|
|
163
168
|
|
|
164
169
|
toJSON () {
|
package/src/users/reseller.js
CHANGED
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
const short = require('short-uuid')
|
|
22
|
+
const { resellerUserService, oxaasService } = require('@open-xchange/soap-client/reseller')
|
|
21
23
|
const event = require('../event')
|
|
24
|
+
const util = require('../util')
|
|
22
25
|
|
|
23
26
|
const users = []
|
|
24
27
|
const usersToRemove = []
|
|
25
28
|
const preprovisionedUsers = []
|
|
26
|
-
const util = require('../util')
|
|
27
|
-
const short = require('short-uuid')
|
|
28
|
-
const { resellerUserService, oxaasService } = require('@open-xchange/soap-client/reseller')
|
|
29
29
|
|
|
30
30
|
class User {
|
|
31
31
|
constructor (opt) {
|
package/src/users/users.js
CHANGED
|
@@ -19,12 +19,13 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
/* eslint-disable camelcase */
|
|
22
|
-
const event = require('../event')
|
|
23
22
|
|
|
24
|
-
const users = []
|
|
25
|
-
const util = require('../util')
|
|
26
23
|
const short = require('short-uuid')
|
|
27
24
|
const { userService } = require('@open-xchange/soap-client/common')
|
|
25
|
+
const event = require('../event')
|
|
26
|
+
const util = require('../util')
|
|
27
|
+
|
|
28
|
+
const users = []
|
|
28
29
|
|
|
29
30
|
class User {
|
|
30
31
|
constructor (opt) {
|