codeceptjs 3.6.4 → 3.6.5-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.
Files changed (88) hide show
  1. package/bin/codecept.js +84 -63
  2. package/lib/assert/empty.js +19 -19
  3. package/lib/assert/equal.js +32 -30
  4. package/lib/assert/error.js +14 -14
  5. package/lib/assert/include.js +42 -42
  6. package/lib/assert/throws.js +13 -11
  7. package/lib/assert/truth.js +17 -18
  8. package/lib/command/configMigrate.js +57 -52
  9. package/lib/command/definitions.js +88 -88
  10. package/lib/command/dryRun.js +65 -63
  11. package/lib/command/generate.js +191 -181
  12. package/lib/command/info.js +39 -37
  13. package/lib/command/init.js +289 -286
  14. package/lib/command/interactive.js +32 -32
  15. package/lib/command/list.js +26 -26
  16. package/lib/command/run-multiple.js +113 -93
  17. package/lib/command/run-rerun.js +22 -22
  18. package/lib/command/run-workers.js +63 -63
  19. package/lib/command/run.js +24 -26
  20. package/lib/command/utils.js +64 -63
  21. package/lib/data/context.js +60 -60
  22. package/lib/data/dataScenarioConfig.js +47 -47
  23. package/lib/data/dataTableArgument.js +29 -29
  24. package/lib/data/table.js +26 -20
  25. package/lib/helper/AI.js +67 -65
  26. package/lib/helper/ApiDataFactory.js +72 -69
  27. package/lib/helper/Appium.js +409 -379
  28. package/lib/helper/ExpectHelper.js +214 -248
  29. package/lib/helper/FileSystem.js +77 -78
  30. package/lib/helper/GraphQL.js +44 -43
  31. package/lib/helper/GraphQLDataFactory.js +49 -50
  32. package/lib/helper/JSONResponse.js +64 -62
  33. package/lib/helper/Mochawesome.js +28 -28
  34. package/lib/helper/MockServer.js +12 -12
  35. package/lib/helper/Nightmare.js +664 -572
  36. package/lib/helper/Playwright.js +1320 -1211
  37. package/lib/helper/Protractor.js +663 -629
  38. package/lib/helper/Puppeteer.js +1232 -1124
  39. package/lib/helper/REST.js +87 -72
  40. package/lib/helper/TestCafe.js +490 -491
  41. package/lib/helper/WebDriver.js +1294 -1156
  42. package/lib/interfaces/bdd.js +38 -51
  43. package/lib/interfaces/featureConfig.js +19 -19
  44. package/lib/interfaces/gherkin.js +122 -111
  45. package/lib/interfaces/scenarioConfig.js +29 -29
  46. package/lib/listener/artifacts.js +9 -9
  47. package/lib/listener/config.js +24 -23
  48. package/lib/listener/exit.js +12 -12
  49. package/lib/listener/helpers.js +42 -42
  50. package/lib/listener/mocha.js +11 -11
  51. package/lib/listener/retry.js +32 -30
  52. package/lib/listener/steps.js +50 -51
  53. package/lib/listener/timeout.js +53 -53
  54. package/lib/plugin/allure.js +14 -14
  55. package/lib/plugin/autoDelay.js +29 -36
  56. package/lib/plugin/autoLogin.js +70 -66
  57. package/lib/plugin/commentStep.js +18 -18
  58. package/lib/plugin/coverage.js +92 -77
  59. package/lib/plugin/customLocator.js +20 -19
  60. package/lib/plugin/debugErrors.js +24 -24
  61. package/lib/plugin/eachElement.js +37 -37
  62. package/lib/plugin/fakerTransform.js +6 -6
  63. package/lib/plugin/heal.js +66 -63
  64. package/lib/plugin/pauseOnFail.js +10 -10
  65. package/lib/plugin/retryFailedStep.js +31 -38
  66. package/lib/plugin/retryTo.js +28 -28
  67. package/lib/plugin/screenshotOnFail.js +107 -86
  68. package/lib/plugin/selenoid.js +131 -117
  69. package/lib/plugin/standardActingHelpers.js +2 -8
  70. package/lib/plugin/stepByStepReport.js +102 -92
  71. package/lib/plugin/stepTimeout.js +23 -22
  72. package/lib/plugin/subtitles.js +34 -34
  73. package/lib/plugin/tryTo.js +39 -29
  74. package/lib/plugin/wdio.js +77 -72
  75. package/lib/template/heal.js +11 -14
  76. package/package.json +4 -2
  77. package/translations/de-DE.js +1 -1
  78. package/translations/fr-FR.js +1 -1
  79. package/translations/index.js +9 -9
  80. package/translations/it-IT.js +1 -1
  81. package/translations/ja-JP.js +1 -1
  82. package/translations/pl-PL.js +1 -1
  83. package/translations/pt-BR.js +1 -1
  84. package/translations/ru-RU.js +1 -1
  85. package/translations/zh-CN.js +1 -1
  86. package/translations/zh-TW.js +1 -1
  87. package/typings/promiseBasedTypes.d.ts +238 -0
  88. package/typings/types.d.ts +32 -0
@@ -1,42 +1,44 @@
1
- const envinfo = require('envinfo');
1
+ const envinfo = require('envinfo')
2
2
 
3
- const { getConfig, getTestRoot } = require('./utils');
4
- const Codecept = require('../codecept');
5
- const output = require('../output');
3
+ const { getConfig, getTestRoot } = require('./utils')
4
+ const Codecept = require('../codecept')
5
+ const output = require('../output')
6
6
 
7
7
  module.exports = async function (path) {
8
- const testsPath = getTestRoot(path);
9
- const config = getConfig(testsPath);
10
- const codecept = new Codecept(config, {});
11
- codecept.init(testsPath);
8
+ const testsPath = getTestRoot(path)
9
+ const config = getConfig(testsPath)
10
+ const codecept = new Codecept(config, {})
11
+ codecept.init(testsPath)
12
12
 
13
- output.print('\n Environment information:-\n');
14
- const info = {};
15
- info.codeceptVersion = Codecept.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";
13
+ output.print('\n Environment information:-\n')
14
+ const info = {}
15
+ info.codeceptVersion = Codecept.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('Please copy environment info when you report issues on GitHub: https://github.com/Codeception/CodeceptJS/issues');
38
- output.print('***************************************');
39
- };
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
+ 'Please copy environment info when you report issues on GitHub: https://github.com/Codeception/CodeceptJS/issues',
39
+ )
40
+ output.print('***************************************')
41
+ }
40
42
 
41
43
  module.exports.getMachineInfo = async () => {
42
44
  const info = {
@@ -47,17 +49,17 @@ module.exports.getMachineInfo = async () => {
47
49
  edgeInfo: await envinfo.helpers.getEdgeInfo(),
48
50
  firefoxInfo: await envinfo.helpers.getFirefoxInfo(),
49
51
  safariInfo: await envinfo.helpers.getSafariInfo(),
50
- };
52
+ }
51
53
 
52
- output.print('***************************************');
54
+ output.print('***************************************')
53
55
  for (const [key, value] of Object.entries(info)) {
54
56
  if (Array.isArray(value)) {
55
- output.print(`${key}: ${value[1]}`);
57
+ output.print(`${key}: ${value[1]}`)
56
58
  } else {
57
- output.print(`${key}: ${JSON.stringify(value, null, ' ')}`);
59
+ output.print(`${key}: ${JSON.stringify(value, null, ' ')}`)
58
60
  }
59
61
  }
60
- output.print('If you need more detailed info, just run this: npx codeceptjs info');
61
- output.print('***************************************');
62
- return info;
63
- };
62
+ output.print('If you need more detailed info, just run this: npx codeceptjs info')
63
+ output.print('***************************************')
64
+ return info
65
+ }