@open-xchange/appsuite-codeceptjs 0.6.15 → 0.6.16

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/index.js CHANGED
@@ -36,6 +36,7 @@ requiredEnvVars.forEach(function notdefined (key) {
36
36
  module.exports = {
37
37
  util: require('./src/util'),
38
38
  event: require('./src/event'),
39
+ actor: require('./src/actor'),
39
40
  codeceptEvents,
40
41
  recorder,
41
42
  config: {
@@ -117,8 +118,8 @@ module.exports = {
117
118
  await ctx.remove().catch(e => console.error(e.message))
118
119
  }
119
120
  },
120
- reporter: 'mocha-multi',
121
121
  mocha: {
122
+ reporter: 'mocha-multi',
122
123
  reporterOptions: {
123
124
  'codeceptjs-cli-reporter': {
124
125
  stdout: '-'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/appsuite-codeceptjs",
3
- "version": "0.6.15",
3
+ "version": "0.6.16",
4
4
  "description": "OX App Suite CodeceptJS Configuration and Helpers",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -23,7 +23,7 @@
23
23
  "chai": "^6.2.1",
24
24
  "chalk": "^4.1.2",
25
25
  "chalk-table": "^1.0.2",
26
- "codeceptjs": "3.7.5",
26
+ "codeceptjs": "3.7.6",
27
27
  "dotenv": "^17.2.3",
28
28
  "mocha": "^11.7.5",
29
29
  "mocha-junit-reporter": "^2.2.1",
@@ -33,8 +33,8 @@
33
33
  "p-retry": "^7.1.1",
34
34
  "playwright-core": "1.57.0",
35
35
  "short-uuid": "^6.0.3",
36
- "@open-xchange/codecept-horizontal-scaler": "0.1.14",
37
- "@open-xchange/soap-client": "0.0.9"
36
+ "@open-xchange/soap-client": "0.0.10",
37
+ "@open-xchange/codecept-horizontal-scaler": "0.1.14"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^24.10.3",
package/src/actor.js CHANGED
@@ -23,9 +23,9 @@ const { expect } = require('@playwright/test')
23
23
  const util = require('./util')
24
24
  const codecept = require('codeceptjs')
25
25
 
26
- const baseURL = util.getURLRoot()
27
-
28
26
  module.exports = function () {
27
+ const baseURL = util.getURLRoot()
28
+
29
29
  return actor({
30
30
 
31
31
  amOnLoginPage () {
@@ -26,12 +26,6 @@ const { contextService, getFilestorageId } = require('@open-xchange/soap-client/
26
26
  const crypto = require('node:crypto')
27
27
  const codecept = require('codeceptjs')
28
28
 
29
- let defaultContext
30
- ;(async () => {
31
- console.log('Fetching default context')
32
- defaultContext = await contextService.getDefault()
33
- })()
34
-
35
29
  class Context {
36
30
  constructor ({ ctxdata, admin, auth }) {
37
31
  this.id = ctxdata.id
@@ -47,8 +41,12 @@ class Context {
47
41
  }
48
42
 
49
43
  async remove () {
50
- // do not remove default context
51
- if (defaultContext !== undefined && this.ctxdata.id === defaultContext.id) throw new Error('Cannot remove default context')
44
+ // Only allow deletion of e2e-created contexts
45
+ const loginMappings = [].concat(this.ctxdata.loginMappings || [])
46
+ const isE2eContext = loginMappings.some(m => m.startsWith('e2e-context-'))
47
+ if (!isE2eContext) {
48
+ throw new Error(`Refusing to delete context ${this.id}: not an e2e-created context (missing e2e-context- prefix in loginMappings)`)
49
+ }
52
50
  try {
53
51
  await contextService.remove(this.ctxdata.id)
54
52
  } catch (e) {
@@ -20,14 +20,13 @@
20
20
 
21
21
  'use strict'
22
22
 
23
- const { recorder } = require('codeceptjs')
23
+ const { recorder, container } = require('codeceptjs')
24
24
  const event = require('../../event')
25
- const Helper = require('../../helper')
26
25
 
27
26
  module.exports = function () {
28
27
  event.dispatcher.on(event.provisioning.user.created, (user) => {
29
28
  recorder.startUnlessRunning()
30
- const helper = new Helper()
29
+ const helper = container.helpers('AppSuite')
31
30
  recorder.add('inject starting in contacts folder setting', async () => {
32
31
  await helper.haveSetting({ 'io.ox/contacts': { startInGlobalAddressbook: false } }, { user })
33
32
  })