@open-xchange/appsuite-codeceptjs 0.7.2 → 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/CHANGELOG.md +178 -0
- package/README.md +1 -15
- package/index.d.ts +33 -2
- package/index.js +8 -13
- package/package.json +9 -15
- package/src/contexts/contexts.js +2 -1
- package/src/contexts/reseller.js +1 -0
- package/src/event.js +6 -1
- package/src/plugins/testmetrics/index.js +16 -15
- package/src/sharedaccounts/sharedaccounts.js +8 -3
- package/src/users/reseller.js +3 -3
- package/src/users/users.js +4 -3
- package/.env.defaults +0 -48
- package/container/Dockerfile +0 -1
- package/pnpm-workspace.yaml +0 -14
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
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
|
+
|
|
18
|
+
## [0.8.0] - 2026-03-15
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Replace chalk and dotenv with Node.js built-ins
|
|
23
|
+
- Clean up dependencies, packaging, and config files
|
|
24
|
+
- Clean up Chromium args and add renderer process limit
|
|
25
|
+
|
|
26
|
+
## [0.7.2] - 2026-03-09
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- TypeScript type definitions
|
|
31
|
+
|
|
32
|
+
## [0.7.0] - 2026-02-24
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- Switch container base image to wolfi/playwright and make output directory configurable
|
|
37
|
+
|
|
38
|
+
## [0.6.20] - 2026-02-24
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- Fix typo in import statement
|
|
43
|
+
|
|
44
|
+
## [0.6.19] - 2026-02-24
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
|
|
48
|
+
- Support for shared accounts in e2e tests
|
|
49
|
+
|
|
50
|
+
## [0.6.18] - 2026-02-23
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
|
|
54
|
+
- Convert various step functions to sync
|
|
55
|
+
|
|
56
|
+
## [0.6.17] - 2026-02-13
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- Helpers for manipulating user settings in tests
|
|
61
|
+
- Allow passing more custom steps to actor()
|
|
62
|
+
|
|
63
|
+
### Fixed
|
|
64
|
+
|
|
65
|
+
- Internal Node exception when requiring appsuite-codeceptjs and chai (#18)
|
|
66
|
+
|
|
67
|
+
## [0.6.16] - 2026-01-22
|
|
68
|
+
|
|
69
|
+
### Added
|
|
70
|
+
|
|
71
|
+
- `e2e-context-` prefix check to prevent accidental context deletion
|
|
72
|
+
- Export "actor" from main module
|
|
73
|
+
|
|
74
|
+
### Changed
|
|
75
|
+
|
|
76
|
+
- Use existing helper instead of creating new instance for every user
|
|
77
|
+
|
|
78
|
+
### Fixed
|
|
79
|
+
|
|
80
|
+
- Location of "reporter" option inside "mocha" object
|
|
81
|
+
- Move `util.getURLRoot` call into actor
|
|
82
|
+
|
|
83
|
+
### Removed
|
|
84
|
+
|
|
85
|
+
- Unnecessary default context fetch on module load
|
|
86
|
+
|
|
87
|
+
## [0.6.14] - 2025-12-12
|
|
88
|
+
|
|
89
|
+
### Changed
|
|
90
|
+
|
|
91
|
+
- Switch Playwright base image from jammy to noble
|
|
92
|
+
|
|
93
|
+
## [0.6.13] - 2025-09-30
|
|
94
|
+
|
|
95
|
+
### Fixed
|
|
96
|
+
|
|
97
|
+
- Unhandled rejection timeout errors in soap-client
|
|
98
|
+
|
|
99
|
+
### Removed
|
|
100
|
+
|
|
101
|
+
- Unit tests (moved elsewhere)
|
|
102
|
+
|
|
103
|
+
## [0.6.12] - 2025-09-25
|
|
104
|
+
|
|
105
|
+
### Changed
|
|
106
|
+
|
|
107
|
+
- Use pageobjects package from core-ui
|
|
108
|
+
|
|
109
|
+
## [0.6.10] - 2025-09-15
|
|
110
|
+
|
|
111
|
+
### Fixed
|
|
112
|
+
|
|
113
|
+
- Use job group name as node-prefix for filter suite
|
|
114
|
+
|
|
115
|
+
## [0.6.7] - 2025-07-18
|
|
116
|
+
|
|
117
|
+
### Fixed
|
|
118
|
+
|
|
119
|
+
- Do not load common contexts when using reseller API
|
|
120
|
+
|
|
121
|
+
## [0.6.4] - 2025-06-13
|
|
122
|
+
|
|
123
|
+
### Changed
|
|
124
|
+
|
|
125
|
+
- Update pageobjects and actor to work with unpatched CodeceptJS
|
|
126
|
+
|
|
127
|
+
## [0.6.3] - 2025-06-11
|
|
128
|
+
|
|
129
|
+
### Added
|
|
130
|
+
|
|
131
|
+
- Documentation for overwriting helpers locally
|
|
132
|
+
|
|
133
|
+
### Changed
|
|
134
|
+
|
|
135
|
+
- Move soap to own library
|
|
136
|
+
- Clean up codeceptjs dependencies
|
|
137
|
+
- Update paths for gitlab.com move
|
|
138
|
+
|
|
139
|
+
### Fixed
|
|
140
|
+
|
|
141
|
+
- Setting startDate and endDate in calendar/createAppointment
|
|
142
|
+
- getNextMonday (pageobjects/calendar) to work on Sunday correctly
|
|
143
|
+
|
|
144
|
+
### Removed
|
|
145
|
+
|
|
146
|
+
- chai-subset (now merged with chai)
|
|
147
|
+
|
|
148
|
+
## [0.6.2] - 2024-12-17
|
|
149
|
+
|
|
150
|
+
### Changed
|
|
151
|
+
|
|
152
|
+
- Replace Jest with Vitest and improve test infrastructure
|
|
153
|
+
- Switch to neostandard library
|
|
154
|
+
|
|
155
|
+
## [0.6.0] - 2024-10-10
|
|
156
|
+
|
|
157
|
+
### Added
|
|
158
|
+
|
|
159
|
+
- allure-js-commons module
|
|
160
|
+
|
|
161
|
+
## [0.5.0] - 2024-09-30
|
|
162
|
+
|
|
163
|
+
### Added
|
|
164
|
+
|
|
165
|
+
- E2E setup and testing for appsuite-codeceptjs
|
|
166
|
+
- Container image
|
|
167
|
+
|
|
168
|
+
## [0.4.4] - 2024-08-27
|
|
169
|
+
|
|
170
|
+
### Fixed
|
|
171
|
+
|
|
172
|
+
- Reseller API support for pre-assembled contexts
|
|
173
|
+
|
|
174
|
+
## [0.4.3] - 2024-08-22
|
|
175
|
+
|
|
176
|
+
### Added
|
|
177
|
+
|
|
178
|
+
- Initial release
|
package/README.md
CHANGED
|
@@ -55,18 +55,4 @@ const { config } = require('@open-xchange/appsuite-codeceptjs')
|
|
|
55
55
|
config.tests = './costum_directory/*_test.js'
|
|
56
56
|
|
|
57
57
|
module.exports.config = config
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Known Issues
|
|
61
|
-
|
|
62
|
-
Add this to your `package.json` to ignore CVE-2025-5889 when installing this package with `pnpm`:
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
"pnpm": {
|
|
66
|
-
"auditConfig": {
|
|
67
|
-
"ignoreCves": [
|
|
68
|
-
"CVE-2025-5889"
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
```
|
|
58
|
+
```
|
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
|
@@ -22,8 +22,9 @@ require('./src/chai')
|
|
|
22
22
|
const { recorder, event: codeceptEvents } = require('codeceptjs')
|
|
23
23
|
const pageobjects = require('@open-xchange/appsuite-codeceptjs-pageobjects')
|
|
24
24
|
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
for (const envFile of ['.env', '.env.defaults']) {
|
|
26
|
+
try { process.loadEnvFile(envFile) } catch {}
|
|
27
|
+
}
|
|
27
28
|
|
|
28
29
|
const outputDir = process.env.E2E_OUTPUT_DIR || './output'
|
|
29
30
|
|
|
@@ -42,7 +43,7 @@ module.exports = {
|
|
|
42
43
|
codeceptEvents,
|
|
43
44
|
recorder,
|
|
44
45
|
config: {
|
|
45
|
-
tests: './tests/**/*_test.js',
|
|
46
|
+
tests: './tests/**/*_test.{js,ts}',
|
|
46
47
|
timeout: Number(process.env.TEST_TIMEOUT) || 120,
|
|
47
48
|
output: outputDir,
|
|
48
49
|
helpers: {
|
|
@@ -52,20 +53,14 @@ module.exports = {
|
|
|
52
53
|
browser: 'chromium',
|
|
53
54
|
chromium: {
|
|
54
55
|
args: [
|
|
55
|
-
'--disable-print-preview',
|
|
56
|
-
'--disable-crash-reporter',
|
|
57
|
-
'--disable-dev-shm-usage',
|
|
58
|
-
'--disable-features=IsolateOrigins',
|
|
59
56
|
'--disable-gpu',
|
|
60
|
-
'--disable-notifications', // to disable native notification window on Mac OS
|
|
57
|
+
'--disable-notifications', // to disable native notification window on Mac OS
|
|
61
58
|
'--disable-print-preview',
|
|
62
59
|
'--disable-setuid-sandbox',
|
|
63
|
-
'--disable-site-isolation-trials',
|
|
64
60
|
'--disable-web-security',
|
|
65
|
-
'--no-
|
|
66
|
-
'--
|
|
67
|
-
|
|
68
|
-
].concat((process.env.CHROME_ARGS || '').split(' '))
|
|
61
|
+
'--no-zygote',
|
|
62
|
+
'--renderer-process-limit=1'
|
|
63
|
+
].concat((process.env.CHROME_ARGS || '').split(' ').filter(Boolean))
|
|
69
64
|
},
|
|
70
65
|
url: process.env.LAUNCH_URL,
|
|
71
66
|
show: process.env.HEADLESS === 'false',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xchange/appsuite-codeceptjs",
|
|
3
|
-
"version": "0.
|
|
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",
|
|
@@ -15,17 +15,14 @@
|
|
|
15
15
|
"license": "AGPL-3.0-or-later",
|
|
16
16
|
"private": false,
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@axe-core/playwright": "^4.11.
|
|
18
|
+
"@axe-core/playwright": "^4.11.1",
|
|
19
19
|
"@codeceptjs/helper": "^2.0.4",
|
|
20
20
|
"@influxdata/influxdb-client": "^1.35.0",
|
|
21
21
|
"@open-xchange/appsuite-codeceptjs-pageobjects": "^1.1.1",
|
|
22
22
|
"@playwright/test": "1.58.2",
|
|
23
23
|
"allure-codeceptjs": "2.15.1",
|
|
24
|
-
"chai": "^6.2.
|
|
25
|
-
"
|
|
26
|
-
"chalk-table": "^1.0.2",
|
|
27
|
-
"codeceptjs": "3.7.6",
|
|
28
|
-
"dotenv": "^17.2.3",
|
|
24
|
+
"chai": "^6.2.2",
|
|
25
|
+
"codeceptjs": "3.7.7",
|
|
29
26
|
"mocha": "^11.7.5",
|
|
30
27
|
"mocha-junit-reporter": "^2.2.1",
|
|
31
28
|
"mocha-multi": "^1.1.7",
|
|
@@ -34,17 +31,14 @@
|
|
|
34
31
|
"p-retry": "^7.1.1",
|
|
35
32
|
"playwright-core": "1.58.2",
|
|
36
33
|
"short-uuid": "^6.0.3",
|
|
37
|
-
"@open-xchange/
|
|
38
|
-
"@open-xchange/
|
|
34
|
+
"@open-xchange/soap-client": "0.1.0",
|
|
35
|
+
"@open-xchange/codecept-horizontal-scaler": "0.1.15"
|
|
39
36
|
},
|
|
40
37
|
"devDependencies": {
|
|
41
|
-
"@types/node": "^
|
|
38
|
+
"@types/node": "^25.5.0",
|
|
42
39
|
"ts-node": "^10.9.2",
|
|
43
|
-
"typescript": "^
|
|
44
|
-
"@open-xchange/lint": "0.
|
|
45
|
-
},
|
|
46
|
-
"resolutions": {
|
|
47
|
-
"axios": ">1.12.0"
|
|
40
|
+
"typescript": "^6.0.0",
|
|
41
|
+
"@open-xchange/lint": "0.3.0"
|
|
48
42
|
},
|
|
49
43
|
"scripts": {
|
|
50
44
|
"lint": "eslint ."
|
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}`
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
const { InfluxDB, Point } = require('@influxdata/influxdb-client')
|
|
22
22
|
const event = require('codeceptjs/lib/event')
|
|
23
23
|
const recorder = require('codeceptjs/lib/recorder')
|
|
24
|
-
const
|
|
25
|
-
const chalkTable = require('chalk-table')
|
|
24
|
+
const { styleText } = require('node:util')
|
|
26
25
|
|
|
27
26
|
function durationOf (test) {
|
|
28
27
|
return test.steps.reduce((sum, step) => sum + (step.endTime - step.startTime), 0)
|
|
@@ -39,18 +38,16 @@ module.exports = function setupTestMetricsPlugin ({ url, org, token, defaultTags
|
|
|
39
38
|
writePoint (p) { points.push(p) },
|
|
40
39
|
flush () {
|
|
41
40
|
if (!points.length) return
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
console.log(chalkTable(options, points.filter(p => p.name !== 'testrun').map(p => {
|
|
41
|
+
const columns = [
|
|
42
|
+
{ field: 'measurement', name: 'Measurement', color: 'cyan' },
|
|
43
|
+
{ field: 'metric', name: 'Metric', color: 'cyan' },
|
|
44
|
+
{ field: 'duration', name: 'Duration', color: 'green' },
|
|
45
|
+
{ field: 'transferSize', name: 'Transfer size', color: 'green' },
|
|
46
|
+
{ field: 'decodedBodySize', name: 'Dec. body size', color: 'green' },
|
|
47
|
+
{ field: 'cached', name: 'Cached', color: 'yellow' },
|
|
48
|
+
{ field: 'tags', name: 'Tags', color: 'cyan' }
|
|
49
|
+
]
|
|
50
|
+
const rows = points.filter(p => p.name !== 'testrun').map(p => {
|
|
54
51
|
const metric = p.tags.metric
|
|
55
52
|
delete p.tags.metric
|
|
56
53
|
const cached = p.tags.cached
|
|
@@ -65,7 +62,11 @@ module.exports = function setupTestMetricsPlugin ({ url, org, token, defaultTags
|
|
|
65
62
|
row[field] = p.fields[field]
|
|
66
63
|
}
|
|
67
64
|
return row
|
|
68
|
-
})
|
|
65
|
+
})
|
|
66
|
+
const widths = columns.map(col => Math.max(col.name.length, ...rows.map(r => String(r[col.field] ?? '').length)))
|
|
67
|
+
const header = columns.map((col, i) => styleText(col.color, col.name.padEnd(widths[i]))).join(' ')
|
|
68
|
+
const lines = rows.map(row => columns.map((col, i) => String(row[col.field] ?? '').padEnd(widths[i])).join(' '))
|
|
69
|
+
console.log([header, ...lines].join('\n'))
|
|
69
70
|
points.splice(0, points.length)
|
|
70
71
|
},
|
|
71
72
|
dispose () {
|
|
@@ -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) {
|
package/.env.defaults
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Default environment variables
|
|
2
|
-
#
|
|
3
|
-
# Do not edit this file, instead create a .env file in the root directory!
|
|
4
|
-
|
|
5
|
-
# CONTEXT_ID only needs to be set for local development
|
|
6
|
-
# CONTEXT_ID=
|
|
7
|
-
|
|
8
|
-
# Admin credentials for e2e middleware
|
|
9
|
-
# PROVISIONING_USER=
|
|
10
|
-
# PROVISIONING_PASSWORD=
|
|
11
|
-
|
|
12
|
-
# SMTP and IMAP server for e2e-tests
|
|
13
|
-
SMTP_SERVER=main-asbox-postfix
|
|
14
|
-
IMAP_SERVER=main-asbox-dovecot
|
|
15
|
-
|
|
16
|
-
# Number of maximum retries of e2e-test runs and minimal successful e2e-test runs
|
|
17
|
-
MIN_SUCCESS=1
|
|
18
|
-
MAX_RERUNS=1
|
|
19
|
-
|
|
20
|
-
# URL to the App Suite Middleware for e2e-provisioning via SOAP
|
|
21
|
-
PROVISIONING_URL=https://appsuite-main.dev.oxui.de/
|
|
22
|
-
|
|
23
|
-
# URL to the App Suite UI for e2e-tests
|
|
24
|
-
LAUNCH_URL=https://core-ui-main.dev.oxui.de
|
|
25
|
-
|
|
26
|
-
# MX domain for e2e-tests
|
|
27
|
-
MX_DOMAIN=box.ox.io
|
|
28
|
-
|
|
29
|
-
# API used for e2e user provisioning (common/reseller)
|
|
30
|
-
PROVISIONING_API=common
|
|
31
|
-
|
|
32
|
-
# Default timeout for all wait operations for e2e tests in ms
|
|
33
|
-
WAIT_TIMEOUT=5000
|
|
34
|
-
|
|
35
|
-
# Run test headless or in chrome (Must be true for CI)
|
|
36
|
-
HEADLESS=true
|
|
37
|
-
|
|
38
|
-
# Test metrics plugin configuration
|
|
39
|
-
E2E_TEST_METRICS_CLIENT=
|
|
40
|
-
E2E_TEST_METRICS_TOKEN=
|
|
41
|
-
|
|
42
|
-
# Path to the chrome binary
|
|
43
|
-
CHROME_BIN=/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
|
|
44
|
-
|
|
45
|
-
# See https://peter.sh/experiments/chromium-command-line-switches
|
|
46
|
-
CHROME_ARGS=
|
|
47
|
-
# CHROME_ARGS: '--disable-accelerated-2d-canvas --no-zygote --single-process'
|
|
48
|
-
DOTENV_CONFIG_QUIET=true
|
package/container/Dockerfile
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
FROM registry.gitlab.com/openxchange/base-images/wolfi/playwright:1.58.2
|
package/pnpm-workspace.yaml
DELETED