codeceptjs 4.2.2 → 4.2.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 +4 -4
- package/docs/ai.md +1 -1
- package/docs/alternative-browsers.md +4 -4
- package/docs/api.md +13 -13
- package/docs/assertions.md +6 -6
- package/docs/best.md +1 -1
- package/docs/bootstrap.md +1 -1
- package/docs/data.md +8 -8
- package/docs/element-selection.md +27 -4
- package/docs/helpers/ApiDataFactory.md +2 -2
- package/docs/helpers/Appium.md +56 -56
- package/docs/helpers/Decision.md +1 -1
- package/docs/helpers/Detox.md +1 -1
- package/docs/helpers/ExpectHelper.md +1 -1
- package/docs/helpers/FileSystem.md +1 -1
- package/docs/helpers/GraphQL.md +1 -1
- package/docs/helpers/GraphQLDataFactory.md +2 -2
- package/docs/helpers/JSONResponse.md +1 -1
- package/docs/helpers/Kitesurf.md +65 -65
- package/docs/helpers/Lightpanda.md +65 -65
- package/docs/helpers/MockRequest.md +1 -1
- package/docs/helpers/Moli.md +65 -65
- package/docs/helpers/Obscura.md +65 -65
- package/docs/helpers/Playwright.md +127 -127
- package/docs/helpers/Puppeteer.md +88 -88
- package/docs/helpers/REST.md +1 -1
- package/docs/helpers/WebDriver.md +87 -87
- package/docs/installation.md +1 -1
- package/docs/locators.md +5 -7
- package/docs/migration-4.md +7 -3
- package/docs/mobile.md +2 -2
- package/docs/parallel.md +1 -1
- package/docs/playwright.md +5 -5
- package/docs/plugins/aiTrace.md +1 -1
- package/docs/plugins/autoDelay.md +1 -1
- package/docs/plugins/customLocator.md +1 -1
- package/docs/plugins/customReporter.md +1 -1
- package/docs/plugins/junitReporter.md +2 -2
- package/docs/plugins/pageInfo.md +1 -1
- package/docs/plugins/pauseOnFail.md +1 -1
- package/docs/plugins/retryFailedStep.md +1 -1
- package/docs/plugins/screenshotOnFail.md +1 -1
- package/docs/plugins/stepTimeout.md +1 -1
- package/docs/plugins.md +10 -10
- package/docs/puppeteer.md +4 -4
- package/docs/retry.md +1 -1
- package/docs/timeouts.md +7 -7
- package/docs/webdriver.md +8 -8
- package/lib/actor.js +20 -2
- package/lib/aria.js +1 -0
- package/lib/codecept.js +1 -1
- package/lib/data/context.js +24 -0
- package/lib/element/WebElement.js +5 -5
- package/lib/helper/ApiDataFactory.js +1 -1
- package/lib/helper/Appium.js +2 -2
- package/lib/helper/GraphQLDataFactory.js +1 -1
- package/lib/helper/Playwright.js +22 -12
- package/lib/helper/Puppeteer.js +5 -11
- package/lib/mocha/asyncWrapper.js +14 -3
- package/lib/mocha/test.js +1 -0
- package/lib/plugin/auth.js +3 -0
- package/lib/plugin/junitReporter.js +21 -12
- package/lib/recorder.js +22 -3
- package/lib/step/base.js +8 -1
- package/lib/step/func.js +1 -1
- package/lib/step/helper.js +1 -1
- package/lib/step/record.js +22 -17
- package/lib/step/retry.js +13 -6
- package/lib/utils/typescript.js +86 -12
- package/lib/workers.js +15 -0
- package/package.json +2 -1
- package/typings/index.d.ts +12 -0
- package/typings/promiseBasedTypes.d.ts +696 -351
- package/typings/types.d.ts +485 -352
package/lib/workers.js
CHANGED
|
@@ -104,9 +104,22 @@ const createWorker = (workerObject, isPoolMode = false, skipTests = []) => {
|
|
|
104
104
|
})
|
|
105
105
|
|
|
106
106
|
WorkerStorage.addWorker(worker)
|
|
107
|
+
worker.runOutputDir = workerObject.runOutputDir
|
|
107
108
|
return worker
|
|
108
109
|
}
|
|
109
110
|
|
|
111
|
+
const tagWithRun = (message, runOutputDir) => {
|
|
112
|
+
if (!message.event || !message.data || typeof message.data !== 'object') return
|
|
113
|
+
const runName = path.basename(runOutputDir)
|
|
114
|
+
const tag = obj => {
|
|
115
|
+
if (!obj || typeof obj !== 'object' || obj.outputDir) return
|
|
116
|
+
obj.outputDir = runOutputDir
|
|
117
|
+
if (obj.uid) obj.uid = `${obj.uid}@${runName}`
|
|
118
|
+
}
|
|
119
|
+
tag(message.data)
|
|
120
|
+
if (Array.isArray(message.data.tests)) message.data.tests.forEach(tag)
|
|
121
|
+
}
|
|
122
|
+
|
|
110
123
|
const simplifyObject = object => {
|
|
111
124
|
return Object.keys(object)
|
|
112
125
|
.filter(k => k.indexOf('_') !== 0)
|
|
@@ -169,6 +182,7 @@ const createWorkerObjects = (testGroups, config, testRoot, options, selectedRuns
|
|
|
169
182
|
workerObj.addTests(tests)
|
|
170
183
|
workerObj.setTestRoot(testRoot)
|
|
171
184
|
workerObj.addOptions(options)
|
|
185
|
+
workerObj.runOutputDir = path.resolve(testRoot, finalConfig.output)
|
|
172
186
|
testWorkerArray.push(workerObj)
|
|
173
187
|
})
|
|
174
188
|
workers.push(...testWorkerArray)
|
|
@@ -659,6 +673,7 @@ class Workers extends EventEmitter {
|
|
|
659
673
|
|
|
660
674
|
worker.on('message', message => {
|
|
661
675
|
lastActivity = Date.now() // Update activity timestamp
|
|
676
|
+
if (worker.runOutputDir) tagWithRun(message, worker.runOutputDir)
|
|
662
677
|
|
|
663
678
|
// Track current test
|
|
664
679
|
if (message.event === event.test.started && message.data) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeceptjs",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Supercharged End 2 End Testing Framework for NodeJS",
|
|
6
6
|
"keywords": [
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"@cucumber/cucumber-expressions": "18",
|
|
98
98
|
"@cucumber/gherkin": "38.0.0",
|
|
99
99
|
"@cucumber/messages": "32.3.1",
|
|
100
|
+
"@jridgewell/trace-mapping": "^0.3.31",
|
|
100
101
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
101
102
|
"@xmldom/xmldom": "^0.9.12",
|
|
102
103
|
"acorn": "8.15.0",
|
package/typings/index.d.ts
CHANGED
|
@@ -527,6 +527,18 @@ declare namespace CodeceptJS {
|
|
|
527
527
|
|
|
528
528
|
type StringOrSecret = string | CodeceptJS.Secret
|
|
529
529
|
|
|
530
|
+
interface StepPromise extends Promise<any> {
|
|
531
|
+
stepConfig(config: CodeceptJS.StepConfig): this
|
|
532
|
+
timeout(seconds: number): this
|
|
533
|
+
retry(retry: number | object): this
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
interface ElementStepPromise extends StepPromise {
|
|
537
|
+
first(): this
|
|
538
|
+
last(): this
|
|
539
|
+
at(position: number): this
|
|
540
|
+
}
|
|
541
|
+
|
|
530
542
|
interface GherkinCallback {
|
|
531
543
|
(test: Test): void | Promise<void>
|
|
532
544
|
}
|