codeceptjs 3.7.0-beta.12 → 3.7.0-beta.14

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/lib/output.js CHANGED
@@ -115,7 +115,7 @@ module.exports = {
115
115
  }
116
116
  }
117
117
 
118
- let stepLine = step.toCliStyled()
118
+ let stepLine = step.toCliStyled ? step.toCliStyled() : step.toString()
119
119
  if (step.metaStep && outputLevel >= 1) {
120
120
  // this.stepShift += 2;
121
121
  stepLine = colors.dim(truncate(stepLine, this.spaceShift))
@@ -2,6 +2,7 @@ const debug = require('debug')('codeceptjs:analyze')
2
2
  const { isMainThread } = require('node:worker_threads')
3
3
  const { arrowRight } = require('figures')
4
4
  const container = require('../container')
5
+ const store = require('../store')
5
6
  const ai = require('../ai')
6
7
  const colors = require('chalk')
7
8
  const ora = require('ora-classic')
@@ -75,6 +76,7 @@ const defaultConfig = {
75
76
 
76
77
  * SUMMARY <summary_of_errors>
77
78
  * CATEGORY <category_of_failure>
79
+ * URL <url_of_failure_if_any>
78
80
  * ERROR <error_message_1>, <error_message_2>, ...
79
81
  * STEP <step_of_failure> (use CodeceptJS format I.click(), I.see(), etc; if all failures happend on the same step)
80
82
  * SUITE <suite_title>, <suite_title> (if SUITE is present, and if all tests in the group have the same suite or suites)
@@ -86,11 +88,6 @@ const defaultConfig = {
86
88
  x ...
87
89
  `,
88
90
  },
89
- {
90
- role: 'assistant',
91
- content: `## '
92
- `,
93
- },
94
91
  ]
95
92
  return messages
96
93
  },
@@ -137,6 +134,7 @@ const defaultConfig = {
137
134
  * ERROR <error_message_1>, <error_message_2>, ...
138
135
  * CATEGORY <category_of_failure>
139
136
  * STEPS <step_of_failure>
137
+ * URL <url_of_failure_if_any>
140
138
 
141
139
  Do not add any other sections or explanations. Only CATEGORY, SUMMARY, STEPS.
142
140
  ${config.vision ? 'Also a screenshot of the page is attached to the prompt.' : ''}
@@ -338,12 +336,13 @@ function serializeTest(test) {
338
336
  }
339
337
 
340
338
  function formatResponse(response) {
341
- if (!response.startsWith('##')) response = '## ' + response
342
339
  return response
340
+ .replace(/<think>([\s\S]*?)<\/think>/g, store.debugMode ? colors.cyan('$1') : '')
343
341
  .split('\n')
344
342
  .map(line => line.trim())
345
343
  .filter(line => !/^[A-Z\s]+$/.test(line))
346
344
  .map(line => markdownToAnsi(line))
347
345
  .map(line => line.replace(/^x /gm, ` ${colors.red.bold('x')} `))
348
346
  .join('\n')
347
+ .trim()
349
348
  }
@@ -1,23 +1,12 @@
1
1
  const { retryTo } = require('../effects')
2
2
 
3
- module.exports = function (config) {
4
- console.log(`
5
- Deprecation Warning: 'retryTo' has been moved to the effects module.
6
- You should update your tests to use it as follows:
7
-
8
- \`\`\`javascript
9
- const { retryTo } = require('codeceptjs/effects');
10
-
11
- // Example: Retry these steps 5 times before failing
12
- await retryTo((tryNum) => {
13
- I.switchTo('#editor frame');
14
- I.click('Open');
15
- I.see('Opened');
16
- }, 5);
17
- \`\`\`
3
+ const defaultConfig = {
4
+ registerGlobal: true,
5
+ }
18
6
 
19
- For more details, refer to the documentation.
20
- `)
7
+ module.exports = function (config) {
8
+ config = Object.assign(defaultConfig, config)
9
+ console.log(`Deprecation Warning: 'retryTo' has been moved to the 'codeceptjs/effects' module`)
21
10
 
22
11
  if (config.registerGlobal) {
23
12
  global.retryTo = retryTo
@@ -1,21 +1,12 @@
1
1
  const { tryTo } = require('../effects')
2
2
 
3
- module.exports = function (config) {
4
- console.log(`
5
- Deprecated Warning: 'tryTo' has been moved to the effects module.
6
- You should update your tests to use it as follows:
7
-
8
- \`\`\`javascript
9
- const { tryTo } = require('codeceptjs/effects');
10
-
11
- // Example: failed step won't fail a test but will return true/false
12
- await tryTo(() => {
13
- I.switchTo('#editor frame');
14
- });
15
- \`\`\`
3
+ const defaultConfig = {
4
+ registerGlobal: true,
5
+ }
16
6
 
17
- For more details, refer to the documentation.
18
- `)
7
+ module.exports = function (config) {
8
+ config = Object.assign(defaultConfig, config)
9
+ console.log(`Deprecation Warning: 'tryTo' has been moved to the 'codeceptjs/effects' module`)
19
10
 
20
11
  if (config.registerGlobal) {
21
12
  global.tryTo = tryTo
package/lib/step/base.js CHANGED
@@ -195,8 +195,8 @@ class Step {
195
195
  args.push(arg.name)
196
196
  } else if (typeof arg == 'string') {
197
197
  args.push(arg)
198
- } else {
199
- args.push(JSON.stringify(arg).slice(0, 300))
198
+ } else if (arg) {
199
+ args.push((JSON.stringify(arg) || '').slice(0, 300))
200
200
  }
201
201
  }
202
202
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.7.0-beta.12",
3
+ "version": "3.7.0-beta.14",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -78,7 +78,7 @@
78
78
  "@codeceptjs/helper": "2.0.4",
79
79
  "@cucumber/cucumber-expressions": "18",
80
80
  "@cucumber/gherkin": "30",
81
- "@cucumber/messages": "27.0.2",
81
+ "@cucumber/messages": "27.1.0",
82
82
  "@xmldom/xmldom": "0.9.7",
83
83
  "acorn": "8.14.0",
84
84
  "arrify": "3.0.0",