@open-xchange/appsuite-codeceptjs 0.4.2 → 0.4.4
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/README.md +0 -4
- package/index.js +4 -1
- package/package.json +6 -6
- package/src/contexts/reseller.js +4 -9
- package/src/soap/services/util.js +2 -1
- package/src/soap/soap.js +3 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -124,7 +124,10 @@ module.exports = {
|
|
|
124
124
|
async teardown () {
|
|
125
125
|
const { contexts } = global.inject()
|
|
126
126
|
// we need to run this sequentially, less stress on the MW
|
|
127
|
-
|
|
127
|
+
const filterFunction = process.env.PROVISIONING_API === 'reseller' ?
|
|
128
|
+
ctx => ctx.name.includes('e2e_context') :
|
|
129
|
+
ctx => /e2e-context-/.test(String(ctx.loginMappings))
|
|
130
|
+
for (const ctx of contexts.filter(filterFunction)) {
|
|
128
131
|
await ctx.remove().catch(e => console.error(e.message))
|
|
129
132
|
}
|
|
130
133
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xchange/appsuite-codeceptjs",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "OX App Suite CodeceptJS Configuration and Helpers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"@axe-core/playwright": "^4.9.1",
|
|
14
14
|
"@codeceptjs/helper": "^2.0.4",
|
|
15
15
|
"@influxdata/influxdb-client": "^1.33.2",
|
|
16
|
-
"@open-xchange/codecept-horizontal-scaler": "^0.1.
|
|
17
|
-
"@playwright/test": "1.
|
|
16
|
+
"@open-xchange/codecept-horizontal-scaler": "^0.1.11",
|
|
17
|
+
"@playwright/test": "1.46.1",
|
|
18
18
|
"allure-codeceptjs": "^2.15.1",
|
|
19
19
|
"chai": "^5.1.1",
|
|
20
20
|
"chai-subset": "^1.6.0",
|
|
21
21
|
"chalk": "^4.1.0",
|
|
22
22
|
"chalk-table": "^1.0.2",
|
|
23
|
-
"codeceptjs": "3.6.
|
|
23
|
+
"codeceptjs": "3.6.5",
|
|
24
24
|
"dotenv": "^16.4.5",
|
|
25
25
|
"mocha": "^10.4.0",
|
|
26
26
|
"mocha-junit-reporter": "^2.2.1",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"moment": "^2.30.1",
|
|
29
29
|
"moment-timezone": "^0.5.45",
|
|
30
30
|
"p-retry": "^6.2.0",
|
|
31
|
-
"playwright-core": "1.
|
|
31
|
+
"playwright-core": "1.46.1",
|
|
32
32
|
"short-uuid": "^5.2.0",
|
|
33
33
|
"soap": "^1.0.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^
|
|
36
|
+
"@types/node": "^22.4.1",
|
|
37
37
|
"ts-node": "^10.9.2",
|
|
38
38
|
"typescript": "^5.4.5"
|
|
39
39
|
}
|
package/src/contexts/reseller.js
CHANGED
|
@@ -159,13 +159,14 @@ class ResellerContext {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
static async create (ctx = {}, adminUser = {}, auth = util.admin(), numberOfUsers = Number(process.env.PROVISIONING_USERS || 10)) {
|
|
162
|
-
|
|
162
|
+
const randomId = crypto.randomUUID()
|
|
163
|
+
ctx = Object.assign({ maxQuota: -1 }, ctx)
|
|
163
164
|
adminUser = Object.assign({
|
|
164
|
-
name: `${ctx.name ||
|
|
165
|
+
name: `${ctx.name || randomId}_admin`
|
|
165
166
|
}, this.defaultAdmin(), adminUser)
|
|
166
167
|
let data; let neededPrefix = ctx._auto_prefix
|
|
167
168
|
delete ctx._auto_prefix
|
|
168
|
-
ctx.name = (process.env.CONTEXT_PREFIX || '') + (ctx.name ||
|
|
169
|
+
ctx.name = (process.env.CONTEXT_PREFIX || '') + (ctx.name || `e2e_context_${randomId}`)
|
|
169
170
|
event.emit(event.provisioning.context.create, ctx, adminUser, auth)
|
|
170
171
|
try {
|
|
171
172
|
data = await resellerContextService.create({
|
|
@@ -211,11 +212,6 @@ class ResellerContext {
|
|
|
211
212
|
return remoteCtx
|
|
212
213
|
}
|
|
213
214
|
|
|
214
|
-
static async all () {
|
|
215
|
-
if (contexts.length === 0) await this.fetchContexts()
|
|
216
|
-
return created.concat(contexts)
|
|
217
|
-
}
|
|
218
|
-
|
|
219
215
|
static async fetchContexts () {
|
|
220
216
|
const list = await resellerContextService.listAll()
|
|
221
217
|
.catch((err) => { throw new util.PropagatedError(err) })
|
|
@@ -226,7 +222,6 @@ class ResellerContext {
|
|
|
226
222
|
|
|
227
223
|
// can't return the class directly, because codecept tries to execute functions
|
|
228
224
|
module.exports = function () {
|
|
229
|
-
ResellerContext.fetchContexts()
|
|
230
225
|
return new Proxy(created, {
|
|
231
226
|
// act like an array if an index is being used
|
|
232
227
|
get (target, prop) {
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
|
|
21
21
|
const { createClientAsync } = require('../soap.js')
|
|
22
22
|
|
|
23
|
-
const OXUtilService = createClientAsync('OXUtilService').then(client => client)
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
* This function retrieves the ID of the first filestorage.
|
|
@@ -29,6 +28,8 @@ const OXUtilService = createClientAsync('OXUtilService').then(client => client)
|
|
|
29
28
|
let fileStoreId
|
|
30
29
|
|
|
31
30
|
async function getFilestorageId () {
|
|
31
|
+
const OXUtilService = createClientAsync('OXUtilService').then(client => client)
|
|
32
|
+
|
|
32
33
|
if (fileStoreId) return fileStoreId
|
|
33
34
|
fileStoreId = (await (await OXUtilService).listFilestoreAsync())[0]?.id
|
|
34
35
|
return fileStoreId
|
package/src/soap/soap.js
CHANGED
|
@@ -87,7 +87,9 @@ function shouldAbortRetry (error) {
|
|
|
87
87
|
/Shared Domain already in use/,
|
|
88
88
|
/No such user/,
|
|
89
89
|
/Mandatory fields in context not set/,
|
|
90
|
-
/A mapping with login info .* already exists
|
|
90
|
+
/A mapping with login info .* already exists/,
|
|
91
|
+
/Id must not be set if pre-assembled context should be used/,
|
|
92
|
+
/Unmarshalling Error/
|
|
91
93
|
]
|
|
92
94
|
const blockedExceptions = [
|
|
93
95
|
'ContextExistsException',
|