codeceptjs 3.6.5-beta.4 → 3.6.5
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 -1
- package/docs/webapi/waitForDisabled.mustache +6 -0
- package/lib/helper/AI.js +43 -33
- package/lib/helper/Playwright.js +29 -1
- package/lib/helper/REST.js +8 -4
- package/lib/locator.js +1 -1
- package/package.json +19 -19
- package/typings/promiseBasedTypes.d.ts +2 -50
- package/typings/types.d.ts +2 -50
package/README.md
CHANGED
|
@@ -9,7 +9,6 @@ Build Status:
|
|
|
9
9
|
|
|
10
10
|
Appium Helper:
|
|
11
11
|
[](https://github.com/codeceptjs/CodeceptJS/actions/workflows/appiumV2_Android.yml)
|
|
12
|
-
[](https://github.com/codeceptjs/CodeceptJS/actions/workflows/appiumV2_iOS.yml)
|
|
13
12
|
|
|
14
13
|
Web Helper:
|
|
15
14
|
[](https://github.com/codeceptjs/CodeceptJS/actions/workflows/playwright.yml)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Waits for element to become disabled (by default waits for 1sec).
|
|
2
|
+
Element can be located by CSS or XPath.
|
|
3
|
+
|
|
4
|
+
@param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
5
|
+
@param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
6
|
+
@returns {void} automatically synchronized promise through #recorder
|
package/lib/helper/AI.js
CHANGED
|
@@ -10,17 +10,21 @@ const { beautify } = require('../utils')
|
|
|
10
10
|
const output = require('../output')
|
|
11
11
|
const { registerVariable } = require('../pause')
|
|
12
12
|
|
|
13
|
+
const gtpRole = {
|
|
14
|
+
user: 'user',
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
/**
|
|
14
18
|
* AI Helper for CodeceptJS.
|
|
15
19
|
*
|
|
16
20
|
* This helper class provides integration with the AI GPT-3.5 or 4 language model for generating responses to questions or prompts within the context of web pages. It allows you to interact with the GPT-3.5 model to obtain intelligent responses based on HTML fragments or general prompts.
|
|
17
|
-
* This helper should be enabled with any web helpers like Playwright or Puppeteer or
|
|
21
|
+
* This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDriver to ensure the HTML context is available.
|
|
18
22
|
*
|
|
19
23
|
* Use it only in development mode. It is recommended to run it only inside pause() mode.
|
|
20
24
|
*
|
|
21
25
|
* ## Configuration
|
|
22
26
|
*
|
|
23
|
-
* This helper should be configured in codecept.
|
|
27
|
+
* This helper should be configured in codecept.conf.{js|ts}
|
|
24
28
|
*
|
|
25
29
|
* * `chunkSize`: (optional, default: 80000) - The maximum number of characters to send to the AI API at once. We split HTML fragments by 8000 chars to not exceed token limit. Increase this value if you use GPT-4.
|
|
26
30
|
*/
|
|
@@ -33,6 +37,7 @@ class AI extends Helper {
|
|
|
33
37
|
chunkSize: 80000,
|
|
34
38
|
}
|
|
35
39
|
this.options = { ...this.options, ...config }
|
|
40
|
+
this.aiAssistant.enable(this.config)
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
_beforeSuite() {
|
|
@@ -68,8 +73,8 @@ class AI extends Helper {
|
|
|
68
73
|
|
|
69
74
|
for (const chunk of htmlChunks) {
|
|
70
75
|
const messages = [
|
|
71
|
-
{ role:
|
|
72
|
-
{ role:
|
|
76
|
+
{ role: gtpRole.user, content: prompt },
|
|
77
|
+
{ role: gtpRole.user, content: `Within this HTML: ${minifyHtml(chunk)}` },
|
|
73
78
|
]
|
|
74
79
|
|
|
75
80
|
if (htmlChunks.length > 1)
|
|
@@ -104,8 +109,8 @@ class AI extends Helper {
|
|
|
104
109
|
const html = await this.helper.grabHTMLFrom(locator)
|
|
105
110
|
|
|
106
111
|
const messages = [
|
|
107
|
-
{ role:
|
|
108
|
-
{ role:
|
|
112
|
+
{ role: gtpRole.user, content: prompt },
|
|
113
|
+
{ role: gtpRole.user, content: `Within this HTML: ${minifyHtml(html)}` },
|
|
109
114
|
]
|
|
110
115
|
|
|
111
116
|
const response = await this._processAIRequest(messages)
|
|
@@ -121,7 +126,7 @@ class AI extends Helper {
|
|
|
121
126
|
* @returns {Promise<string>} - A Promise that resolves to the generated response from the GPT model.
|
|
122
127
|
*/
|
|
123
128
|
async askGptGeneralPrompt(prompt) {
|
|
124
|
-
const messages = [{ role:
|
|
129
|
+
const messages = [{ role: gtpRole.user, content: prompt }]
|
|
125
130
|
|
|
126
131
|
const response = await this._processAIRequest(messages)
|
|
127
132
|
|
|
@@ -156,40 +161,45 @@ class AI extends Helper {
|
|
|
156
161
|
* @returns {Promise<Object>} A promise that resolves to the requested page object.
|
|
157
162
|
*/
|
|
158
163
|
async askForPageObject(pageName, extraPrompt = null, locator = null) {
|
|
159
|
-
const html = locator ? await this.helper.grabHTMLFrom(locator) : await this.helper.grabSource()
|
|
160
|
-
|
|
161
164
|
const spinner = ora(' Processing AI request...').start()
|
|
162
|
-
await this.aiAssistant.setHtmlContext(html)
|
|
163
|
-
const response = await this.aiAssistant.generatePageObject(extraPrompt, locator)
|
|
164
|
-
spinner.stop()
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
try {
|
|
167
|
+
const html = locator ? await this.helper.grabHTMLFrom(locator) : await this.helper.grabSource()
|
|
168
|
+
await this.aiAssistant.setHtmlContext(html)
|
|
169
|
+
const response = await this.aiAssistant.generatePageObject(extraPrompt, locator)
|
|
170
|
+
spinner.stop()
|
|
171
|
+
|
|
172
|
+
if (!response[0]) {
|
|
173
|
+
output.error('No response from AI')
|
|
174
|
+
return ''
|
|
175
|
+
}
|
|
170
176
|
|
|
171
|
-
|
|
177
|
+
const code = beautify(response[0])
|
|
172
178
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
179
|
+
output.print('----- Generated PageObject ----')
|
|
180
|
+
output.print(code)
|
|
181
|
+
output.print('-------------------------------')
|
|
176
182
|
|
|
177
|
-
|
|
183
|
+
const fileName = path.join(output_dir, `${pageName}Page-${Date.now()}.js`)
|
|
178
184
|
|
|
179
|
-
|
|
180
|
-
|
|
185
|
+
output.print(output.styles.bold(`Page object for ${pageName} is saved to ${output.styles.bold(fileName)}`))
|
|
186
|
+
fs.writeFileSync(fileName, code)
|
|
181
187
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
try {
|
|
189
|
+
registerVariable('page', require(fileName))
|
|
190
|
+
output.success('Page object registered for this session as `page` variable')
|
|
191
|
+
output.print('Use `=>page.methodName()` in shell to run methods of page object')
|
|
192
|
+
output.print('Use `click(page.locatorName)` to check locators of page object')
|
|
193
|
+
} catch (err) {
|
|
194
|
+
output.error('Error while registering page object')
|
|
195
|
+
output.error(err.message)
|
|
196
|
+
}
|
|
191
197
|
|
|
192
|
-
|
|
198
|
+
return code
|
|
199
|
+
} catch (e) {
|
|
200
|
+
spinner.stop()
|
|
201
|
+
throw Error(`Something went wrong! ${e.message}`)
|
|
202
|
+
}
|
|
193
203
|
}
|
|
194
204
|
|
|
195
205
|
async _processAIRequest(messages) {
|
package/lib/helper/Playwright.js
CHANGED
|
@@ -2476,7 +2476,7 @@ class Playwright extends Helper {
|
|
|
2476
2476
|
async waitForEnabled(locator, sec) {
|
|
2477
2477
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout
|
|
2478
2478
|
locator = new Locator(locator, 'css')
|
|
2479
|
-
|
|
2479
|
+
|
|
2480
2480
|
let waiter
|
|
2481
2481
|
const context = await this._getContext()
|
|
2482
2482
|
if (!locator.isXPath()) {
|
|
@@ -2498,6 +2498,34 @@ class Playwright extends Helper {
|
|
|
2498
2498
|
})
|
|
2499
2499
|
}
|
|
2500
2500
|
|
|
2501
|
+
/**
|
|
2502
|
+
* {{> waitForDisabled }}
|
|
2503
|
+
*/
|
|
2504
|
+
async waitForDisabled(locator, sec) {
|
|
2505
|
+
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout
|
|
2506
|
+
locator = new Locator(locator, 'css')
|
|
2507
|
+
|
|
2508
|
+
let waiter
|
|
2509
|
+
const context = await this._getContext()
|
|
2510
|
+
if (!locator.isXPath()) {
|
|
2511
|
+
const valueFn = function ([locator]) {
|
|
2512
|
+
return Array.from(document.querySelectorAll(locator)).filter((el) => el.disabled).length > 0
|
|
2513
|
+
}
|
|
2514
|
+
waiter = context.waitForFunction(valueFn, [locator.value], { timeout: waitTimeout })
|
|
2515
|
+
} else {
|
|
2516
|
+
const disabledFn = function ([locator, $XPath]) {
|
|
2517
|
+
eval($XPath) // eslint-disable-line no-eval
|
|
2518
|
+
return $XPath(null, locator).filter((el) => el.disabled).length > 0
|
|
2519
|
+
}
|
|
2520
|
+
waiter = context.waitForFunction(disabledFn, [locator.value, $XPath.toString()], { timeout: waitTimeout })
|
|
2521
|
+
}
|
|
2522
|
+
return waiter.catch((err) => {
|
|
2523
|
+
throw new Error(
|
|
2524
|
+
`element (${locator.toString()}) is still enabled after ${waitTimeout / 1000} sec\n${err.message}`,
|
|
2525
|
+
)
|
|
2526
|
+
})
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2501
2529
|
/**
|
|
2502
2530
|
* {{> waitForValue }}
|
|
2503
2531
|
*/
|
package/lib/helper/REST.js
CHANGED
|
@@ -206,7 +206,7 @@ class REST extends Helper {
|
|
|
206
206
|
: this.debugSection('Request', JSON.stringify(_debugRequest))
|
|
207
207
|
|
|
208
208
|
if (this.options.printCurl) {
|
|
209
|
-
this.debugSection('CURL Request', curlize(request))
|
|
209
|
+
this.debugSection('CURL Request', curlize(request))
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
let response
|
|
@@ -393,8 +393,13 @@ class REST extends Helper {
|
|
|
393
393
|
module.exports = REST
|
|
394
394
|
|
|
395
395
|
function curlize(request) {
|
|
396
|
-
if (request.data?.constructor.name.toLowerCase() === 'formdata')
|
|
397
|
-
|
|
396
|
+
if (request.data?.constructor.name.toLowerCase() === 'formdata')
|
|
397
|
+
return 'cURL is not printed as the request body is not a JSON'
|
|
398
|
+
let curl =
|
|
399
|
+
`curl --location --request ${request.method ? request.method.toUpperCase() : 'GET'} ${request.baseURL} `.replace(
|
|
400
|
+
"'",
|
|
401
|
+
'',
|
|
402
|
+
)
|
|
398
403
|
|
|
399
404
|
if (request.headers) {
|
|
400
405
|
Object.entries(request.headers).forEach(([key, value]) => {
|
|
@@ -411,4 +416,3 @@ function curlize(request) {
|
|
|
411
416
|
}
|
|
412
417
|
return curl
|
|
413
418
|
}
|
|
414
|
-
|
package/lib/locator.js
CHANGED
|
@@ -175,7 +175,7 @@ class Locator {
|
|
|
175
175
|
*/
|
|
176
176
|
toXPath(pseudoSelector = '') {
|
|
177
177
|
const locator = `${this.value}${pseudoSelector}`;
|
|
178
|
-
const limitation = [':nth-of-type', ':first-of-type', ':last-of-type', ':nth-last-child', ':nth-last-of-type', ':checked', ':disabled', ':enabled', ':required', ':lang', ':nth-child'];
|
|
178
|
+
const limitation = [':nth-of-type', ':first-of-type', ':last-of-type', ':nth-last-child', ':nth-last-of-type', ':checked', ':disabled', ':enabled', ':required', ':lang', ':nth-child', ':has'];
|
|
179
179
|
|
|
180
180
|
if (limitation.some(item => locator.includes(item))) {
|
|
181
181
|
cssToXPath = require('css-to-xpath');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeceptjs",
|
|
3
|
-
"version": "3.6.5
|
|
3
|
+
"version": "3.6.5",
|
|
4
4
|
"description": "Supercharged End 2 End Testing Framework for NodeJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"acceptance",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@cucumber/gherkin": "26",
|
|
76
76
|
"@cucumber/messages": "25.0.1",
|
|
77
77
|
"@xmldom/xmldom": "0.8.10",
|
|
78
|
-
"acorn": "8.
|
|
78
|
+
"acorn": "8.12.1",
|
|
79
79
|
"arrify": "2.0.1",
|
|
80
80
|
"axios": "1.7.2",
|
|
81
81
|
"chai": "5.1.1",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"cross-spawn": "7.0.3",
|
|
91
91
|
"css-to-xpath": "0.1.0",
|
|
92
92
|
"csstoxpath": "1.6.0",
|
|
93
|
-
"devtools": "8.
|
|
93
|
+
"devtools": "8.39.1",
|
|
94
94
|
"envinfo": "7.11.1",
|
|
95
95
|
"escape-string-regexp": "4.0.0",
|
|
96
96
|
"figures": "3.2.0",
|
|
@@ -99,13 +99,13 @@
|
|
|
99
99
|
"glob": "6.0.1",
|
|
100
100
|
"html-minifier-terser": "7.2.0",
|
|
101
101
|
"inquirer": "6.5.2",
|
|
102
|
-
"joi": "17.13.
|
|
102
|
+
"joi": "17.13.3",
|
|
103
103
|
"js-beautify": "1.15.1",
|
|
104
104
|
"lodash.clonedeep": "4.5.0",
|
|
105
105
|
"lodash.merge": "4.6.2",
|
|
106
106
|
"mkdirp": "1.0.4",
|
|
107
|
-
"mocha": "10.
|
|
108
|
-
"monocart-coverage-reports": "2.
|
|
107
|
+
"mocha": "10.6.0",
|
|
108
|
+
"monocart-coverage-reports": "2.10.0",
|
|
109
109
|
"ms": "2.1.3",
|
|
110
110
|
"ora-classic": "5.4.2",
|
|
111
111
|
"pactum": "3.6.9",
|
|
@@ -117,17 +117,17 @@
|
|
|
117
117
|
"uuid": "9.0"
|
|
118
118
|
},
|
|
119
119
|
"optionalDependencies": {
|
|
120
|
-
"@codeceptjs/detox-helper": "1.0.
|
|
120
|
+
"@codeceptjs/detox-helper": "1.0.8"
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
123
|
"@codeceptjs/mock-request": "0.3.1",
|
|
124
124
|
"@faker-js/faker": "7.6.0",
|
|
125
125
|
"@pollyjs/adapter-puppeteer": "6.0.6",
|
|
126
126
|
"@pollyjs/core": "5.1.0",
|
|
127
|
-
"@types/chai": "4.3.
|
|
127
|
+
"@types/chai": "4.3.16",
|
|
128
128
|
"@types/inquirer": "9.0.3",
|
|
129
129
|
"@types/node": "20.11.30",
|
|
130
|
-
"@wdio/sauce-service": "8.
|
|
130
|
+
"@wdio/sauce-service": "8.39.1",
|
|
131
131
|
"@wdio/selenium-standalone-service": "8.3.2",
|
|
132
132
|
"@wdio/utils": "8.38.2",
|
|
133
133
|
"@xmldom/xmldom": "0.8.10",
|
|
@@ -136,37 +136,37 @@
|
|
|
136
136
|
"chai-subset": "1.6.0",
|
|
137
137
|
"contributor-faces": "1.1.0",
|
|
138
138
|
"documentation": "12.3.0",
|
|
139
|
-
"electron": "
|
|
139
|
+
"electron": "31.3.0",
|
|
140
140
|
"eslint": "8.57.0",
|
|
141
141
|
"eslint-config-airbnb-base": "15.0.0",
|
|
142
142
|
"eslint-plugin-import": "2.29.1",
|
|
143
143
|
"eslint-plugin-mocha": "10.4.3",
|
|
144
144
|
"expect": "29.7.0",
|
|
145
145
|
"express": "4.19.2",
|
|
146
|
-
"graphql": "
|
|
147
|
-
"husky": "
|
|
146
|
+
"graphql": "16.9.0",
|
|
147
|
+
"husky": "9.1.1",
|
|
148
148
|
"inquirer-test": "2.0.1",
|
|
149
149
|
"jsdoc": "4.0.3",
|
|
150
150
|
"jsdoc-typeof-plugin": "1.0.0",
|
|
151
151
|
"json-server": "0.10.1",
|
|
152
|
-
"playwright": "1.
|
|
152
|
+
"playwright": "1.45.3",
|
|
153
153
|
"prettier": "^3.3.2",
|
|
154
|
-
"puppeteer": "22.
|
|
154
|
+
"puppeteer": "22.12.1",
|
|
155
155
|
"qrcode-terminal": "0.12.0",
|
|
156
156
|
"rosie": "2.1.1",
|
|
157
157
|
"runok": "0.9.3",
|
|
158
158
|
"sinon": "18.0.0",
|
|
159
159
|
"sinon-chai": "3.7.0",
|
|
160
160
|
"testcafe": "3.5.0",
|
|
161
|
-
"ts-morph": "
|
|
161
|
+
"ts-morph": "23.0.0",
|
|
162
162
|
"ts-node": "10.9.2",
|
|
163
163
|
"tsd": "^0.31.0",
|
|
164
164
|
"tsd-jsdoc": "2.5.0",
|
|
165
|
-
"typedoc": "0.
|
|
166
|
-
"typedoc-plugin-markdown": "4.
|
|
167
|
-
"typescript": "5.
|
|
165
|
+
"typedoc": "0.26.5",
|
|
166
|
+
"typedoc-plugin-markdown": "4.2.1",
|
|
167
|
+
"typescript": "5.5.3",
|
|
168
168
|
"wdio-docker-service": "1.5.0",
|
|
169
|
-
"webdriverio": "8.
|
|
169
|
+
"webdriverio": "8.39.1",
|
|
170
170
|
"xml2js": "0.6.2",
|
|
171
171
|
"xpath": "0.0.34"
|
|
172
172
|
},
|
|
@@ -3,13 +3,13 @@ declare namespace CodeceptJS {
|
|
|
3
3
|
* AI Helper for CodeceptJS.
|
|
4
4
|
*
|
|
5
5
|
* This helper class provides integration with the AI GPT-3.5 or 4 language model for generating responses to questions or prompts within the context of web pages. It allows you to interact with the GPT-3.5 model to obtain intelligent responses based on HTML fragments or general prompts.
|
|
6
|
-
* This helper should be enabled with any web helpers like Playwright or Puppeteer or
|
|
6
|
+
* This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDriver to ensure the HTML context is available.
|
|
7
7
|
*
|
|
8
8
|
* Use it only in development mode. It is recommended to run it only inside pause() mode.
|
|
9
9
|
*
|
|
10
10
|
* ## Configuration
|
|
11
11
|
*
|
|
12
|
-
* This helper should be configured in codecept.
|
|
12
|
+
* This helper should be configured in codecept.conf.{js|ts}
|
|
13
13
|
*
|
|
14
14
|
* * `chunkSize`: (optional, default: 80000) - The maximum number of characters to send to the AI API at once. We split HTML fragments by 8000 chars to not exceed token limit. Increase this value if you use GPT-4.
|
|
15
15
|
*/
|
|
@@ -1180,12 +1180,6 @@ declare namespace CodeceptJS {
|
|
|
1180
1180
|
*
|
|
1181
1181
|
* ## Methods
|
|
1182
1182
|
*/
|
|
1183
|
-
// @ts-ignore
|
|
1184
|
-
// @ts-ignore
|
|
1185
|
-
// @ts-ignore
|
|
1186
|
-
// @ts-ignore
|
|
1187
|
-
// @ts-ignore
|
|
1188
|
-
// @ts-ignore
|
|
1189
1183
|
class ExpectHelper {
|
|
1190
1184
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1191
1185
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
@@ -1297,12 +1291,6 @@ declare namespace CodeceptJS {
|
|
|
1297
1291
|
*
|
|
1298
1292
|
* ## Methods
|
|
1299
1293
|
*/
|
|
1300
|
-
// @ts-ignore
|
|
1301
|
-
// @ts-ignore
|
|
1302
|
-
// @ts-ignore
|
|
1303
|
-
// @ts-ignore
|
|
1304
|
-
// @ts-ignore
|
|
1305
|
-
// @ts-ignore
|
|
1306
1294
|
class ExpectHelper {
|
|
1307
1295
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1308
1296
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
@@ -1974,12 +1962,6 @@ declare namespace CodeceptJS {
|
|
|
1974
1962
|
* @property [host = "0.0.0.0"] - Mock server host
|
|
1975
1963
|
* @property [httpsOpts] - key & cert values are the paths to .key and .crt files
|
|
1976
1964
|
*/
|
|
1977
|
-
// @ts-ignore
|
|
1978
|
-
// @ts-ignore
|
|
1979
|
-
// @ts-ignore
|
|
1980
|
-
// @ts-ignore
|
|
1981
|
-
// @ts-ignore
|
|
1982
|
-
// @ts-ignore
|
|
1983
1965
|
type MockServerConfig = {
|
|
1984
1966
|
port?: number;
|
|
1985
1967
|
host?: string;
|
|
@@ -2104,12 +2086,6 @@ declare namespace CodeceptJS {
|
|
|
2104
2086
|
*
|
|
2105
2087
|
* ## Methods
|
|
2106
2088
|
*/
|
|
2107
|
-
// @ts-ignore
|
|
2108
|
-
// @ts-ignore
|
|
2109
|
-
// @ts-ignore
|
|
2110
|
-
// @ts-ignore
|
|
2111
|
-
// @ts-ignore
|
|
2112
|
-
// @ts-ignore
|
|
2113
2089
|
class MockServer {
|
|
2114
2090
|
/**
|
|
2115
2091
|
* Start the mock server
|
|
@@ -3183,12 +3159,6 @@ declare namespace CodeceptJS {
|
|
|
3183
3159
|
* @property [recordHar] - record HAR and will be saved to `output/har`. See more of [HAR options](https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har).
|
|
3184
3160
|
* @property [testIdAttribute = data-testid] - locate elements based on the testIdAttribute. See more of [locate by test id](https://playwright.dev/docs/locators#locate-by-test-id).
|
|
3185
3161
|
*/
|
|
3186
|
-
// @ts-ignore
|
|
3187
|
-
// @ts-ignore
|
|
3188
|
-
// @ts-ignore
|
|
3189
|
-
// @ts-ignore
|
|
3190
|
-
// @ts-ignore
|
|
3191
|
-
// @ts-ignore
|
|
3192
3162
|
type PlaywrightConfig = {
|
|
3193
3163
|
url?: string;
|
|
3194
3164
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -6565,12 +6535,6 @@ declare namespace CodeceptJS {
|
|
|
6565
6535
|
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
6566
6536
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
6567
6537
|
*/
|
|
6568
|
-
// @ts-ignore
|
|
6569
|
-
// @ts-ignore
|
|
6570
|
-
// @ts-ignore
|
|
6571
|
-
// @ts-ignore
|
|
6572
|
-
// @ts-ignore
|
|
6573
|
-
// @ts-ignore
|
|
6574
6538
|
type PuppeteerConfig = {
|
|
6575
6539
|
url: string;
|
|
6576
6540
|
basicAuth?: any;
|
|
@@ -8377,12 +8341,6 @@ declare namespace CodeceptJS {
|
|
|
8377
8341
|
* @property [onResponse] - an async function which can update response object.
|
|
8378
8342
|
* @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
|
|
8379
8343
|
*/
|
|
8380
|
-
// @ts-ignore
|
|
8381
|
-
// @ts-ignore
|
|
8382
|
-
// @ts-ignore
|
|
8383
|
-
// @ts-ignore
|
|
8384
|
-
// @ts-ignore
|
|
8385
|
-
// @ts-ignore
|
|
8386
8344
|
type RESTConfig = {
|
|
8387
8345
|
endpoint?: string;
|
|
8388
8346
|
prettyPrintJson?: boolean;
|
|
@@ -9501,12 +9459,6 @@ declare namespace CodeceptJS {
|
|
|
9501
9459
|
* @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
|
|
9502
9460
|
* @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
|
|
9503
9461
|
*/
|
|
9504
|
-
// @ts-ignore
|
|
9505
|
-
// @ts-ignore
|
|
9506
|
-
// @ts-ignore
|
|
9507
|
-
// @ts-ignore
|
|
9508
|
-
// @ts-ignore
|
|
9509
|
-
// @ts-ignore
|
|
9510
9462
|
type WebDriverConfig = {
|
|
9511
9463
|
url: string;
|
|
9512
9464
|
browser: string;
|
package/typings/types.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ declare namespace CodeceptJS {
|
|
|
3
3
|
* AI Helper for CodeceptJS.
|
|
4
4
|
*
|
|
5
5
|
* This helper class provides integration with the AI GPT-3.5 or 4 language model for generating responses to questions or prompts within the context of web pages. It allows you to interact with the GPT-3.5 model to obtain intelligent responses based on HTML fragments or general prompts.
|
|
6
|
-
* This helper should be enabled with any web helpers like Playwright or Puppeteer or
|
|
6
|
+
* This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDriver to ensure the HTML context is available.
|
|
7
7
|
*
|
|
8
8
|
* Use it only in development mode. It is recommended to run it only inside pause() mode.
|
|
9
9
|
*
|
|
10
10
|
* ## Configuration
|
|
11
11
|
*
|
|
12
|
-
* This helper should be configured in codecept.
|
|
12
|
+
* This helper should be configured in codecept.conf.{js|ts}
|
|
13
13
|
*
|
|
14
14
|
* * `chunkSize`: (optional, default: 80000) - The maximum number of characters to send to the AI API at once. We split HTML fragments by 8000 chars to not exceed token limit. Increase this value if you use GPT-4.
|
|
15
15
|
*/
|
|
@@ -1204,12 +1204,6 @@ declare namespace CodeceptJS {
|
|
|
1204
1204
|
*
|
|
1205
1205
|
* ## Methods
|
|
1206
1206
|
*/
|
|
1207
|
-
// @ts-ignore
|
|
1208
|
-
// @ts-ignore
|
|
1209
|
-
// @ts-ignore
|
|
1210
|
-
// @ts-ignore
|
|
1211
|
-
// @ts-ignore
|
|
1212
|
-
// @ts-ignore
|
|
1213
1207
|
class ExpectHelper {
|
|
1214
1208
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1215
1209
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
@@ -1321,12 +1315,6 @@ declare namespace CodeceptJS {
|
|
|
1321
1315
|
*
|
|
1322
1316
|
* ## Methods
|
|
1323
1317
|
*/
|
|
1324
|
-
// @ts-ignore
|
|
1325
|
-
// @ts-ignore
|
|
1326
|
-
// @ts-ignore
|
|
1327
|
-
// @ts-ignore
|
|
1328
|
-
// @ts-ignore
|
|
1329
|
-
// @ts-ignore
|
|
1330
1318
|
class ExpectHelper {
|
|
1331
1319
|
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1332
1320
|
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
@@ -2001,12 +1989,6 @@ declare namespace CodeceptJS {
|
|
|
2001
1989
|
* @property [host = "0.0.0.0"] - Mock server host
|
|
2002
1990
|
* @property [httpsOpts] - key & cert values are the paths to .key and .crt files
|
|
2003
1991
|
*/
|
|
2004
|
-
// @ts-ignore
|
|
2005
|
-
// @ts-ignore
|
|
2006
|
-
// @ts-ignore
|
|
2007
|
-
// @ts-ignore
|
|
2008
|
-
// @ts-ignore
|
|
2009
|
-
// @ts-ignore
|
|
2010
1992
|
type MockServerConfig = {
|
|
2011
1993
|
port?: number;
|
|
2012
1994
|
host?: string;
|
|
@@ -2131,12 +2113,6 @@ declare namespace CodeceptJS {
|
|
|
2131
2113
|
*
|
|
2132
2114
|
* ## Methods
|
|
2133
2115
|
*/
|
|
2134
|
-
// @ts-ignore
|
|
2135
|
-
// @ts-ignore
|
|
2136
|
-
// @ts-ignore
|
|
2137
|
-
// @ts-ignore
|
|
2138
|
-
// @ts-ignore
|
|
2139
|
-
// @ts-ignore
|
|
2140
2116
|
class MockServer {
|
|
2141
2117
|
/**
|
|
2142
2118
|
* Start the mock server
|
|
@@ -3276,12 +3252,6 @@ declare namespace CodeceptJS {
|
|
|
3276
3252
|
* @property [recordHar] - record HAR and will be saved to `output/har`. See more of [HAR options](https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har).
|
|
3277
3253
|
* @property [testIdAttribute = data-testid] - locate elements based on the testIdAttribute. See more of [locate by test id](https://playwright.dev/docs/locators#locate-by-test-id).
|
|
3278
3254
|
*/
|
|
3279
|
-
// @ts-ignore
|
|
3280
|
-
// @ts-ignore
|
|
3281
|
-
// @ts-ignore
|
|
3282
|
-
// @ts-ignore
|
|
3283
|
-
// @ts-ignore
|
|
3284
|
-
// @ts-ignore
|
|
3285
3255
|
type PlaywrightConfig = {
|
|
3286
3256
|
url?: string;
|
|
3287
3257
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -6809,12 +6779,6 @@ declare namespace CodeceptJS {
|
|
|
6809
6779
|
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
6810
6780
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
6811
6781
|
*/
|
|
6812
|
-
// @ts-ignore
|
|
6813
|
-
// @ts-ignore
|
|
6814
|
-
// @ts-ignore
|
|
6815
|
-
// @ts-ignore
|
|
6816
|
-
// @ts-ignore
|
|
6817
|
-
// @ts-ignore
|
|
6818
6782
|
type PuppeteerConfig = {
|
|
6819
6783
|
url: string;
|
|
6820
6784
|
basicAuth?: any;
|
|
@@ -8757,12 +8721,6 @@ declare namespace CodeceptJS {
|
|
|
8757
8721
|
* @property [onResponse] - an async function which can update response object.
|
|
8758
8722
|
* @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
|
|
8759
8723
|
*/
|
|
8760
|
-
// @ts-ignore
|
|
8761
|
-
// @ts-ignore
|
|
8762
|
-
// @ts-ignore
|
|
8763
|
-
// @ts-ignore
|
|
8764
|
-
// @ts-ignore
|
|
8765
|
-
// @ts-ignore
|
|
8766
8724
|
type RESTConfig = {
|
|
8767
8725
|
endpoint?: string;
|
|
8768
8726
|
prettyPrintJson?: boolean;
|
|
@@ -9941,12 +9899,6 @@ declare namespace CodeceptJS {
|
|
|
9941
9899
|
* @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
|
|
9942
9900
|
* @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
|
|
9943
9901
|
*/
|
|
9944
|
-
// @ts-ignore
|
|
9945
|
-
// @ts-ignore
|
|
9946
|
-
// @ts-ignore
|
|
9947
|
-
// @ts-ignore
|
|
9948
|
-
// @ts-ignore
|
|
9949
|
-
// @ts-ignore
|
|
9950
9902
|
type WebDriverConfig = {
|
|
9951
9903
|
url: string;
|
|
9952
9904
|
browser: string;
|