@open-xchange/appsuite-codeceptjs 0.6.3 → 0.6.6

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/.env.defaults CHANGED
@@ -45,3 +45,4 @@ CHROME_BIN=/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
45
45
  # See https://peter.sh/experiments/chromium-command-line-switches
46
46
  CHROME_ARGS=
47
47
  # CHROME_ARGS: '--disable-accelerated-2d-canvas --no-zygote --single-process'
48
+ DOTENV_CONFIG_QUIET=true
@@ -1 +1 @@
1
- FROM registry.gitlab.com/openxchange/appsuite/web-foundation/base-images/playwright:v1.53.0-jammy
1
+ FROM registry.gitlab.com/openxchange/appsuite/web-foundation/base-images/playwright:v1.53.2-jammy
package/index.js CHANGED
@@ -19,9 +19,10 @@
19
19
  */
20
20
 
21
21
  require('./src/chai')
22
+ const { recorder, event: codeceptEvents } = require('codeceptjs')
23
+
22
24
  const dotenv = require('dotenv')
23
- dotenv.config({ path: '.env' })
24
- dotenv.config({ path: '.env.defaults' })
25
+ dotenv.config({ path: ['.env', '.env.defaults'], quiet: true })
25
26
 
26
27
  const requiredEnvVars = ['LAUNCH_URL', 'PROVISIONING_URL']
27
28
 
@@ -34,6 +35,8 @@ requiredEnvVars.forEach(function notdefined (key) {
34
35
  module.exports = {
35
36
  util: require('./src/util'),
36
37
  event: require('./src/event'),
38
+ codeceptEvents,
39
+ recorder,
37
40
  config: {
38
41
  tests: './tests/**/*_test.js',
39
42
  timeout: Number(process.env.TEST_TIMEOUT) || 120,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/appsuite-codeceptjs",
3
- "version": "0.6.3",
3
+ "version": "0.6.6",
4
4
  "description": "OX App Suite CodeceptJS Configuration and Helpers",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -14,31 +14,31 @@
14
14
  "license": "AGPL-3.0-or-later",
15
15
  "private": false,
16
16
  "dependencies": {
17
- "@axe-core/playwright": "^4.10.1",
17
+ "@axe-core/playwright": "^4.10.2",
18
18
  "@codeceptjs/helper": "^2.0.4",
19
19
  "@influxdata/influxdb-client": "^1.35.0",
20
- "@playwright/test": "1.53.0",
20
+ "@playwright/test": "1.54.1",
21
21
  "allure-codeceptjs": "2.15.1",
22
- "chai": "^5.2.0",
22
+ "chai": "^5.2.1",
23
23
  "chalk": "^4.1.2",
24
24
  "chalk-table": "^1.0.2",
25
25
  "codeceptjs": "3.7.3",
26
- "dotenv": "^16.4.7",
27
- "mocha": "^11.1.0",
26
+ "dotenv": "^17.2.0",
27
+ "mocha": "^11.7.1",
28
28
  "mocha-junit-reporter": "^2.2.1",
29
29
  "mocha-multi": "^1.1.7",
30
30
  "moment": "^2.30.1",
31
31
  "moment-timezone": "^0.6.0",
32
32
  "p-retry": "^6.2.1",
33
- "playwright-core": "1.53.0",
33
+ "playwright-core": "1.54.1",
34
34
  "short-uuid": "^5.2.0",
35
- "@open-xchange/codecept-horizontal-scaler": "0.1.12",
36
- "@open-xchange/soap-client": "0.0.1"
35
+ "@open-xchange/soap-client": "0.0.2",
36
+ "@open-xchange/codecept-horizontal-scaler": "0.1.12"
37
37
  },
38
38
  "devDependencies": {
39
- "@types/node": "^24.0.0",
39
+ "@types/node": "^24.0.14",
40
40
  "ts-node": "^10.9.2",
41
- "typescript": "^5.8.2",
41
+ "typescript": "^5.8.3",
42
42
  "@open-xchange/lint": "0.2.0"
43
43
  },
44
44
  "scripts": {
package/src/actor.js CHANGED
@@ -107,7 +107,7 @@ module.exports = function () {
107
107
  *
108
108
  * @param {string} locator - The locator of the element. Only accepts css selectors.
109
109
  */
110
- waitForFocus (locator) {
110
+ async waitForFocus (locator) {
111
111
  this.waitForElement(locator)
112
112
  this.waitForVisible(locator)
113
113
  return this.usePlaywrightTo('wait for focus', async ({ page }) => {
@@ -22,8 +22,9 @@ const created = []
22
22
  const users = require('../users/users')()
23
23
  const util = require('../util')
24
24
  const event = require('../event')
25
- const { contextService } = require('@open-xchange/soap-client/common')
25
+ const { contextService, getFilestorageId } = require('@open-xchange/soap-client/common')
26
26
  const crypto = require('node:crypto')
27
+ const codecept = require('codeceptjs')
27
28
 
28
29
  class Context {
29
30
  constructor ({ ctxdata, admin, auth }) {
@@ -125,7 +126,8 @@ class Context {
125
126
  } catch (error) {
126
127
  // For mws that don't have autocontextid
127
128
  if (error.message.includes('Mandatory fields in context not set: [id]')) {
128
- newCtx.filestoreId = await util.getContextFilestorageId()
129
+ const ox = codecept.config.get().helpers.AppSuite
130
+ newCtx.filestoreId = ox.filestoreId || String(await getFilestorageId())
129
131
  newCtx.id = util.addJitter(util.userContextId())
130
132
  data = await contextService.create(newCtx)
131
133
  } else throw error
@@ -26,12 +26,14 @@ module.exports = {
26
26
  editWindow: '.io-ox-calendar-edit-window',
27
27
  miniCalendar: '.window-sidepanel .date-picker',
28
28
  title: '[data-extension-point="io.ox/calendar/edit/section"] input[name="summary"]',
29
+ location: '[data-extension-point="io.ox/calendar/edit/section"] input[name="location"]',
30
+ description: '[data-extension-point="io.ox/calendar/edit/section"] textarea[name="description"]',
29
31
 
30
32
  async newAppointment () {
31
33
  I.wait(1)
32
34
  I.clickPrimary('New appointment')
33
35
  I.waitForVisible(this.editWindow)
34
- await I.waitForFocus('.io-ox-calendar-edit-window input[type="text"][name="summary"]')
36
+ return I.waitForFocus('.io-ox-calendar-edit-window input[type="text"][name="summary"]')
35
37
  },
36
38
 
37
39
  clickAppointment (title, position = 1) {
@@ -104,17 +106,14 @@ module.exports = {
104
106
  }, attr)
105
107
  },
106
108
 
107
- async addParticipant (name, exists, context, addedParticipants) {
109
+ addParticipant (name, exists = true, context) {
108
110
  if (!context) context = '*'
109
- if (!addedParticipants) addedParticipants = 1
110
111
 
111
112
  // does suggestion exists (for contact, user, ...)
112
- exists = typeof exists === 'boolean' ? exists : true
113
- const number = await I.grabNumberOfVisibleElements(locate('.attendee').inside(context).as('Attendee')) + addedParticipants
114
113
  const addParticipantsLocator = locate('.add-participant.tt-input').inside(context).as('Add participant field')
115
114
  // input field
116
115
  I.waitForVisible(addParticipantsLocator)
117
- I.waitForEnabled(addParticipantsLocator)
116
+ // I.waitForEnabled(addParticipantsLocator)
118
117
  I.fillField(addParticipantsLocator, name)
119
118
  I.seeInField(addParticipantsLocator, name)
120
119
  // tokenfield/typeahead
@@ -126,7 +125,6 @@ module.exports = {
126
125
 
127
126
  I.waitForInvisible(autocomplete.suggestions)
128
127
  // note: might be more than one that get's added (group)
129
- I.waitForElement(locate('.attendee').inside(context).at(number).as(`Attendee ${number}`))
130
128
  },
131
129
 
132
130
  async addParticipantByPicker (name) {
@@ -137,11 +135,18 @@ module.exports = {
137
135
  },
138
136
 
139
137
  switchView (view) {
138
+ const viewMap = {
139
+ Day: 'week:day',
140
+ Week: 'week:week',
141
+ Workweek: 'week:workweek',
142
+ Month: 'month',
143
+ List: 'list'
144
+ }
140
145
  I.waitForElement('.page.current .calendar-header > .dropdown button')
141
146
  I.click('.page.current .calendar-header > .dropdown button')
142
147
  I.waitForText(view, undefined, '.open .dropdown-menu')
143
148
  I.click(locate('.dropdown.open a').withText(view).as('Switch to ' + view))
144
- I.wait(2)
149
+ I.waitForVisible(`.io-ox-pagecontroller.page.current[data-page-id="io.ox/calendar/${viewMap[view]}"]`)
145
150
  },
146
151
 
147
152
  getFullname (user) {
@@ -23,6 +23,8 @@ const { I, dialogs } = inject()
23
23
  module.exports = {
24
24
 
25
25
  editWindow: '.io-ox-contacts-edit-window',
26
+ title: '.io-ox-contacts-edit-window input[name="title"]',
27
+ note: '.io-ox-contacts-edit-window textarea[name="note"]',
26
28
 
27
29
  selectContact (text) {
28
30
  I.waitForElement(`.vgrid [aria-label="${text}"]`)
@@ -36,7 +36,6 @@ module.exports = {
36
36
  I.wait(1)
37
37
  I.click(item)
38
38
  await I.waitForFocus('.list-view li.list-item.selected')
39
- I.waitForElement('.mail-detail-frame')
40
39
  },
41
40
  async selectMailByIndex (index) {
42
41
  const item = locate('.list-view li.list-item').withAttr({ 'data-index': index.toString() }).as('Mail item')
@@ -26,8 +26,7 @@ module.exports = {
26
26
  I.wait(0.5) // prevent clicking a detached element caused by the bottom toolbar being re-rendered multiple times
27
27
  I.waitForElement('~New contact')
28
28
  I.click({ css: '[data-action="io.ox/contacts/actions/create"]' })
29
- I.waitForElement('.io-ox-contacts-edit-window')
30
- I.waitForVisible('.io-ox-contacts-edit-window.complete')
29
+ I.waitForVisible('.io-ox-contacts-edit-window input[name="first_name"]')
31
30
  I.waitForText('Add personal info')
32
31
  },
33
32
 
package/src/util.js CHANGED
@@ -20,7 +20,6 @@
20
20
 
21
21
  const codecept = require('codeceptjs')
22
22
  const url = require('node:url')
23
- const { getFilestorageId } = require('@open-xchange/soap-client/common')
24
23
 
25
24
  module.exports = {
26
25
 
@@ -85,11 +84,6 @@ module.exports = {
85
84
  return ox.defaultUserPassword || 'secret'
86
85
  },
87
86
 
88
- async getContextFilestorageId () {
89
- const ox = codecept.config.get().helpers.AppSuite
90
- return ox.filestoreId || String(await getFilestorageId())
91
- },
92
-
93
87
  PropagatedError: class PropagatedError extends Error {
94
88
  constructor (error) {
95
89
  super(error.message)