codeceptjs 3.6.7 → 4.0.0-beta.1
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/bin/codecept.js +81 -84
- package/lib/actor.js +13 -13
- package/lib/ai.js +13 -10
- package/lib/assert/empty.js +21 -20
- package/lib/assert/equal.js +39 -37
- package/lib/assert/error.js +14 -14
- package/lib/assert/include.js +47 -46
- package/lib/assert/throws.js +11 -13
- package/lib/assert/truth.js +22 -19
- package/lib/assert.js +2 -4
- package/lib/cli.js +49 -57
- package/lib/codecept.js +155 -142
- package/lib/colorUtils.js +3 -3
- package/lib/command/configMigrate.js +52 -58
- package/lib/command/definitions.js +89 -88
- package/lib/command/dryRun.js +68 -71
- package/lib/command/generate.js +188 -197
- package/lib/command/gherkin/init.js +16 -27
- package/lib/command/gherkin/snippets.js +20 -20
- package/lib/command/gherkin/steps.js +8 -8
- package/lib/command/info.js +38 -40
- package/lib/command/init.js +288 -290
- package/lib/command/interactive.js +32 -32
- package/lib/command/list.js +26 -26
- package/lib/command/run-multiple/chunk.js +5 -5
- package/lib/command/run-multiple/collection.js +3 -3
- package/lib/command/run-multiple/run.js +2 -6
- package/lib/command/run-multiple.js +93 -113
- package/lib/command/run-rerun.js +25 -20
- package/lib/command/run-workers.js +66 -64
- package/lib/command/run.js +29 -26
- package/lib/command/utils.js +65 -80
- package/lib/command/workers/runTests.js +10 -10
- package/lib/config.js +9 -10
- package/lib/container.js +48 -40
- package/lib/data/context.js +59 -60
- package/lib/data/dataScenarioConfig.js +47 -47
- package/lib/data/dataTableArgument.js +29 -29
- package/lib/data/table.js +20 -26
- package/lib/dirname.js +5 -0
- package/lib/event.js +167 -163
- package/lib/heal.js +17 -13
- package/lib/helper/AI.js +41 -130
- package/lib/helper/ApiDataFactory.js +69 -73
- package/lib/helper/Appium.js +381 -412
- package/lib/helper/Expect.js +425 -0
- package/lib/helper/ExpectHelper.js +48 -40
- package/lib/helper/FileSystem.js +79 -80
- package/lib/helper/GraphQL.js +43 -44
- package/lib/helper/GraphQLDataFactory.js +50 -50
- package/lib/helper/JSONResponse.js +62 -65
- package/lib/helper/Mochawesome.js +28 -28
- package/lib/helper/MockServer.js +14 -12
- package/lib/helper/Nightmare.js +566 -662
- package/lib/helper/Playwright.js +1216 -1361
- package/lib/helper/Protractor.js +627 -663
- package/lib/helper/Puppeteer.js +1128 -1231
- package/lib/helper/REST.js +68 -159
- package/lib/helper/SoftExpectHelper.js +2 -2
- package/lib/helper/TestCafe.js +484 -490
- package/lib/helper/WebDriver.js +1156 -1297
- package/lib/helper/clientscripts/PollyWebDriverExt.js +1 -1
- package/lib/helper/errors/ConnectionRefused.js +1 -1
- package/lib/helper/errors/ElementAssertion.js +2 -2
- package/lib/helper/errors/ElementNotFound.js +2 -2
- package/lib/helper/errors/RemoteBrowserConnectionRefused.js +1 -1
- package/lib/helper/extras/Console.js +1 -1
- package/lib/helper/extras/PlaywrightPropEngine.js +2 -2
- package/lib/helper/extras/PlaywrightReactVueLocator.js +1 -1
- package/lib/helper/extras/PlaywrightRestartOpts.js +18 -21
- package/lib/helper/extras/Popup.js +1 -1
- package/lib/helper/extras/React.js +3 -3
- package/lib/helper/network/actions.js +7 -14
- package/lib/helper/network/utils.js +2 -3
- package/lib/helper/scripts/blurElement.js +1 -1
- package/lib/helper/scripts/focusElement.js +1 -1
- package/lib/helper/scripts/highlightElement.js +1 -1
- package/lib/helper/scripts/isElementClickable.js +1 -1
- package/lib/helper/testcafe/testControllerHolder.js +1 -1
- package/lib/helper/testcafe/testcafe-utils.js +7 -6
- package/lib/helper.js +3 -1
- package/lib/history.js +5 -6
- package/lib/hooks.js +6 -6
- package/lib/html.js +7 -7
- package/lib/index.js +41 -25
- package/lib/interfaces/bdd.js +64 -47
- package/lib/interfaces/featureConfig.js +19 -19
- package/lib/interfaces/gherkin.js +118 -124
- package/lib/interfaces/scenarioConfig.js +29 -29
- package/lib/listener/artifacts.js +9 -9
- package/lib/listener/config.js +24 -24
- package/lib/listener/exit.js +12 -12
- package/lib/listener/helpers.js +42 -42
- package/lib/listener/mocha.js +11 -11
- package/lib/listener/retry.js +30 -32
- package/lib/listener/steps.js +53 -50
- package/lib/listener/timeout.js +54 -54
- package/lib/locator.js +10 -6
- package/lib/mochaFactory.js +15 -18
- package/lib/output.js +10 -6
- package/lib/parser.js +12 -15
- package/lib/pause.js +33 -40
- package/lib/plugin/allure.js +15 -15
- package/lib/plugin/autoDelay.js +37 -29
- package/lib/plugin/autoLogin.js +65 -70
- package/lib/plugin/commentStep.js +18 -18
- package/lib/plugin/coverage.js +67 -115
- package/lib/plugin/customLocator.js +20 -21
- package/lib/plugin/debugErrors.js +24 -24
- package/lib/plugin/eachElement.js +38 -38
- package/lib/plugin/fakerTransform.js +6 -6
- package/lib/plugin/heal.js +108 -67
- package/lib/plugin/pauseOnFail.js +11 -11
- package/lib/plugin/retryFailedStep.js +39 -32
- package/lib/plugin/retryTo.js +40 -46
- package/lib/plugin/screenshotOnFail.js +87 -109
- package/lib/plugin/selenoid.js +118 -131
- package/lib/plugin/standardActingHelpers.js +8 -2
- package/lib/plugin/stepByStepReport.js +91 -110
- package/lib/plugin/stepTimeout.js +23 -24
- package/lib/plugin/subtitles.js +35 -34
- package/lib/plugin/tryTo.js +30 -40
- package/lib/plugin/wdio.js +75 -78
- package/lib/recorder.js +17 -14
- package/lib/rerun.js +10 -11
- package/lib/scenario.js +23 -25
- package/lib/secret.js +2 -4
- package/lib/session.js +10 -10
- package/lib/step.js +9 -12
- package/lib/store.js +3 -2
- package/lib/transform.js +1 -1
- package/lib/translation.js +8 -7
- package/lib/ui.js +14 -12
- package/lib/utils.js +72 -70
- package/lib/within.js +10 -10
- package/lib/workerStorage.js +25 -27
- package/lib/workers.js +32 -29
- package/package.json +53 -51
- package/translations/de-DE.js +1 -1
- package/translations/fr-FR.js +1 -1
- package/translations/index.js +13 -9
- package/translations/it-IT.js +1 -1
- package/translations/ja-JP.js +1 -1
- package/translations/pl-PL.js +1 -1
- package/translations/pt-BR.js +1 -1
- package/translations/ru-RU.js +1 -1
- package/translations/zh-CN.js +1 -1
- package/translations/zh-TW.js +1 -1
- package/typings/index.d.ts +65 -415
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { getConfig, getTestRoot } from '../utils.js';
|
|
2
|
+
import Codecept from '../../codecept.js';
|
|
3
|
+
import * as output from '../../output.js';
|
|
4
|
+
import { getSteps } from '../../interfaces/bdd.js';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
export default function (genPath, options) {
|
|
7
7
|
const configFile = options.config || genPath;
|
|
8
8
|
const testsPath = getTestRoot(configFile);
|
|
9
9
|
const config = getConfig(configFile);
|
|
@@ -16,10 +16,10 @@ module.exports = function (genPath, options) {
|
|
|
16
16
|
output.print();
|
|
17
17
|
const steps = getSteps();
|
|
18
18
|
for (const step of Object.keys(steps)) {
|
|
19
|
-
output.print(` ${output.colors.bold(step)} ${output.colors.green(steps[step].line || '')}`);
|
|
19
|
+
output.print(` ${output.output.colors.bold(step)} ${output.output.colors.green(steps[step].line || '')}`);
|
|
20
20
|
}
|
|
21
21
|
output.print();
|
|
22
22
|
if (!Object.keys(steps).length) {
|
|
23
|
-
output.error('No Gherkin steps defined');
|
|
23
|
+
output.output.error('No Gherkin steps defined');
|
|
24
24
|
}
|
|
25
|
-
}
|
|
25
|
+
}
|
package/lib/command/info.js
CHANGED
|
@@ -1,46 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
import envinfo from 'envinfo';
|
|
2
|
+
import { getConfig, getTestRoot } from './utils.js';
|
|
3
|
+
import Codecept from '../codecept.js';
|
|
4
|
+
import * as codeceptInstance from '../codecept.js';
|
|
5
|
+
import * as output from '../output.js';
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
7
|
+
export default async function (path) {
|
|
8
|
+
const testsPath = getTestRoot(path);
|
|
9
|
+
const config = getConfig(testsPath);
|
|
10
|
+
const codecept = new Codecept(config, {});
|
|
11
|
+
codecept.init(testsPath);
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
info.
|
|
16
|
-
info.
|
|
17
|
-
|
|
18
|
-
info.
|
|
19
|
-
info.
|
|
20
|
-
info.edgeInfo = await envinfo.helpers.getEdgeInfo()
|
|
21
|
-
info.firefoxInfo = await envinfo.helpers.getFirefoxInfo()
|
|
22
|
-
info.safariInfo = await envinfo.helpers.getSafariInfo()
|
|
23
|
-
const { helpers, plugins } = config
|
|
24
|
-
info.helpers = helpers || "You don't use any helpers"
|
|
25
|
-
info.plugins = plugins || "You don't have any enabled plugins"
|
|
13
|
+
output.print('\n Environment information:-\n');
|
|
14
|
+
const info = {};
|
|
15
|
+
info.codeceptVersion = codeceptInstance.version();
|
|
16
|
+
info.nodeInfo = await envinfo.helpers.getNodeInfo();
|
|
17
|
+
info.osInfo = await envinfo.helpers.getOSInfo();
|
|
18
|
+
info.cpuInfo = await envinfo.helpers.getCPUInfo();
|
|
19
|
+
info.chromeInfo = await envinfo.helpers.getChromeInfo();
|
|
20
|
+
info.edgeInfo = await envinfo.helpers.getEdgeInfo();
|
|
21
|
+
info.firefoxInfo = await envinfo.helpers.getFirefoxInfo();
|
|
22
|
+
info.safariInfo = await envinfo.helpers.getSafariInfo();
|
|
23
|
+
const { helpers, plugins } = config;
|
|
24
|
+
info.helpers = helpers || "You don't use any helpers";
|
|
25
|
+
info.plugins = plugins || "You don't have any enabled plugins";
|
|
26
26
|
|
|
27
27
|
for (const [key, value] of Object.entries(info)) {
|
|
28
28
|
if (Array.isArray(value)) {
|
|
29
|
-
output.print(`${key}: ${value[1]}`)
|
|
29
|
+
output.print(`${key}: ${value[1]}`);
|
|
30
30
|
} else {
|
|
31
|
-
output.print(`${key}: ${JSON.stringify(value, null, ' ')}`)
|
|
31
|
+
output.print(`${key}: ${JSON.stringify(value, null, ' ')}`);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
output.print('***************************************')
|
|
35
|
-
output.print('If you have questions ask them in our Slack: http://bit.ly/chat-codeceptjs')
|
|
36
|
-
output.print('Or ask them on our discussion board: https://codecept.discourse.group/')
|
|
37
|
-
output.print(
|
|
38
|
-
|
|
39
|
-
)
|
|
40
|
-
output.print('***************************************')
|
|
34
|
+
output.print('***************************************');
|
|
35
|
+
output.print('If you have questions ask them in our Slack: http://bit.ly/chat-codeceptjs');
|
|
36
|
+
output.print('Or ask them on our discussion board: https://codecept.discourse.group/');
|
|
37
|
+
output.print('Please copy environment info when you report issues on GitHub: https://github.com/Codeception/CodeceptJS/issues');
|
|
38
|
+
output.print('***************************************');
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
|
|
41
|
+
export async function getMachineInfo() {
|
|
44
42
|
const info = {
|
|
45
43
|
nodeInfo: await envinfo.helpers.getNodeInfo(),
|
|
46
44
|
osInfo: await envinfo.helpers.getOSInfo(),
|
|
@@ -49,17 +47,17 @@ module.exports.getMachineInfo = async () => {
|
|
|
49
47
|
edgeInfo: await envinfo.helpers.getEdgeInfo(),
|
|
50
48
|
firefoxInfo: await envinfo.helpers.getFirefoxInfo(),
|
|
51
49
|
safariInfo: await envinfo.helpers.getSafariInfo(),
|
|
52
|
-
}
|
|
50
|
+
};
|
|
53
51
|
|
|
54
|
-
output.print('***************************************')
|
|
52
|
+
output.print('***************************************');
|
|
55
53
|
for (const [key, value] of Object.entries(info)) {
|
|
56
54
|
if (Array.isArray(value)) {
|
|
57
|
-
output.print(`${key}: ${value[1]}`)
|
|
55
|
+
output.print(`${key}: ${value[1]}`);
|
|
58
56
|
} else {
|
|
59
|
-
output.print(`${key}: ${JSON.stringify(value, null, ' ')}`)
|
|
57
|
+
output.print(`${key}: ${JSON.stringify(value, null, ' ')}`);
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
|
-
output.print('If you need more detailed info, just run this: npx codeceptjs info')
|
|
63
|
-
output.print('***************************************')
|
|
64
|
-
return info
|
|
60
|
+
output.print('If you need more detailed info, just run this: npx codeceptjs info');
|
|
61
|
+
output.print('***************************************');
|
|
62
|
+
return info;
|
|
65
63
|
}
|