@wdio/cli 9.0.0-alpha.9 → 9.0.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 (86) hide show
  1. package/build/commands/config.d.ts.map +1 -1
  2. package/build/commands/repl.d.ts.map +1 -1
  3. package/build/commands/run.d.ts +14 -13
  4. package/build/commands/run.d.ts.map +1 -1
  5. package/build/constants.d.ts +83 -10
  6. package/build/constants.d.ts.map +1 -1
  7. package/build/index.cjs +46 -0
  8. package/build/index.d.cts +2 -0
  9. package/build/index.d.cts.map +1 -0
  10. package/build/index.js +3233 -4
  11. package/build/interface.d.ts +0 -1
  12. package/build/interface.d.ts.map +1 -1
  13. package/build/launcher.d.ts.map +1 -1
  14. package/build/run.d.ts.map +1 -1
  15. package/build/types.d.ts +3 -4
  16. package/build/types.d.ts.map +1 -1
  17. package/build/utils.d.ts +7 -11
  18. package/build/utils.d.ts.map +1 -1
  19. package/build/watcher.d.ts.map +1 -1
  20. package/package.json +20 -25
  21. package/build/cjs/index.d.ts +0 -2
  22. package/build/cjs/index.d.ts.map +0 -1
  23. package/build/cjs/index.js +0 -26
  24. package/build/cjs/package.json +0 -5
  25. package/build/commands/config.js +0 -197
  26. package/build/commands/index.js +0 -5
  27. package/build/commands/install.js +0 -109
  28. package/build/commands/repl.js +0 -50
  29. package/build/commands/run.js +0 -262
  30. package/build/constants.js +0 -909
  31. package/build/install.js +0 -38
  32. package/build/interface.js +0 -285
  33. package/build/launcher.js +0 -513
  34. package/build/run.js +0 -75
  35. package/build/templates/EjsHelpers.js +0 -59
  36. package/build/templates/EjsHelpers.ts +0 -84
  37. package/build/templates/exampleFiles/browser/Component.css.ejs +0 -121
  38. package/build/templates/exampleFiles/browser/Component.lit.ejs +0 -154
  39. package/build/templates/exampleFiles/browser/Component.lit.test.ejs +0 -24
  40. package/build/templates/exampleFiles/browser/Component.preact.ejs +0 -28
  41. package/build/templates/exampleFiles/browser/Component.preact.test.ejs +0 -59
  42. package/build/templates/exampleFiles/browser/Component.react.ejs +0 -29
  43. package/build/templates/exampleFiles/browser/Component.react.test.ejs +0 -58
  44. package/build/templates/exampleFiles/browser/Component.solid.ejs +0 -28
  45. package/build/templates/exampleFiles/browser/Component.solid.test.ejs +0 -58
  46. package/build/templates/exampleFiles/browser/Component.stencil.ejs +0 -43
  47. package/build/templates/exampleFiles/browser/Component.stencil.test.ejs +0 -45
  48. package/build/templates/exampleFiles/browser/Component.svelte.ejs +0 -47
  49. package/build/templates/exampleFiles/browser/Component.svelte.test.ejs +0 -58
  50. package/build/templates/exampleFiles/browser/Component.vue.ejs +0 -34
  51. package/build/templates/exampleFiles/browser/Component.vue.test.ejs +0 -62
  52. package/build/templates/exampleFiles/browser/standalone.test.ejs +0 -13
  53. package/build/templates/exampleFiles/cucumber/features/login.feature +0 -12
  54. package/build/templates/exampleFiles/cucumber/step_definitions/steps.js.ejs +0 -55
  55. package/build/templates/exampleFiles/mochaJasmine/test.e2e.js.ejs +0 -11
  56. package/build/templates/exampleFiles/pageobjects/login.page.js.ejs +0 -45
  57. package/build/templates/exampleFiles/pageobjects/page.js.ejs +0 -17
  58. package/build/templates/exampleFiles/pageobjects/secure.page.js.ejs +0 -20
  59. package/build/templates/exampleFiles/serenity-js/common/config/serenity.properties.ejs +0 -1
  60. package/build/templates/exampleFiles/serenity-js/common/serenity/github-api/GitHubStatus.ts.ejs +0 -41
  61. package/build/templates/exampleFiles/serenity-js/common/serenity/todo-list-app/TodoList.ts.ejs +0 -100
  62. package/build/templates/exampleFiles/serenity-js/common/serenity/todo-list-app/TodoListItem.ts.ejs +0 -36
  63. package/build/templates/exampleFiles/serenity-js/cucumber/step-definitions/steps.ts.ejs +0 -37
  64. package/build/templates/exampleFiles/serenity-js/cucumber/support/parameter.config.ts.ejs +0 -18
  65. package/build/templates/exampleFiles/serenity-js/cucumber/todo-list/completing_items.feature.ejs +0 -23
  66. package/build/templates/exampleFiles/serenity-js/cucumber/todo-list/narrative.md.ejs +0 -17
  67. package/build/templates/exampleFiles/serenity-js/jasmine/example.spec.ts.ejs +0 -86
  68. package/build/templates/exampleFiles/serenity-js/mocha/example.spec.ts.ejs +0 -88
  69. package/build/templates/snippets/afterTest.ejs +0 -20
  70. package/build/templates/snippets/capabilities.ejs +0 -57
  71. package/build/templates/snippets/cucumber.ejs +0 -50
  72. package/build/templates/snippets/electronTest.js.ejs +0 -7
  73. package/build/templates/snippets/jasmine.ejs +0 -20
  74. package/build/templates/snippets/macosTest.js.ejs +0 -11
  75. package/build/templates/snippets/mocha.ejs +0 -14
  76. package/build/templates/snippets/reporters.ejs +0 -14
  77. package/build/templates/snippets/serenity.ejs +0 -18
  78. package/build/templates/snippets/services.ejs +0 -18
  79. package/build/templates/snippets/testWithPO.js.ejs +0 -22
  80. package/build/templates/snippets/testWithoutPO.js.ejs +0 -19
  81. package/build/templates/snippets/vscodeTest.js.ejs +0 -9
  82. package/build/templates/wdio.conf.tpl.ejs +0 -422
  83. package/build/types.js +0 -1
  84. package/build/utils.js +0 -930
  85. package/build/watcher.js +0 -156
  86. /package/{LICENSE-MIT → LICENSE} +0 -0
@@ -1,422 +0,0 @@
1
- <%
2
- if (answers.isUsingTypeScript && answers.purpose === 'electron') {
3
- %>/// <reference types="wdio-electron-service" />
4
- <% }
5
-
6
- if (answers.isUsingTypeScript && !answers.serenityAdapter) {
7
- %>import type { Options } from '@wdio/types'
8
- <% }
9
-
10
- if (answers.isUsingTypeScript && answers.serenityAdapter) {
11
- %>import type { WebdriverIOConfig } from '@serenity-js/webdriverio'
12
- <% }
13
-
14
- if (answers.isUsingTypeScript) {
15
- %>export const config: <%= answers.serenityAdapter ? 'WebdriverIOConfig' : 'Options.Testrunner' %> = {<%
16
- } else if (answers.esmSupport) {
17
- %>export const config = {<%
18
- } else {
19
- %>exports.config = {<%
20
- } %>
21
- //
22
- // ====================
23
- // Runner Configuration
24
- // ====================
25
- // WebdriverIO supports running e2e tests as well as unit and component tests.
26
- runner: <%
27
- if (answers.runner === 'browser') {
28
- if (answers.preset) {
29
- %>['browser', {
30
- preset: '<%- answers.preset %>',
31
- // start browser window when `DEBUG` environment variable is set
32
- headless: !Boolean(process.env.DEBUG)
33
- }]<%
34
- } else {
35
- %>'browser'<%
36
- }
37
- } else {
38
- %>'local'<%
39
- }
40
- %>,<%
41
- if (answers.isUsingTypeScript) { %>
42
- autoCompileOpts: {
43
- autoCompile: true,
44
- tsNodeOpts: {
45
- project: '<%- answers.tsProject %>',
46
- transpileOnly: true
47
- }
48
- },
49
- <% }
50
- if(answers.expEnvAccessKey){ %>
51
- hostname: '<%- answers.expEnvHostname %>',
52
- <% if (answers.expEnvPort === '443'){%>protocol: 'https',
53
- <%} else if (answers.expEnvPort === '80'){%>protocol: 'http',
54
- <%} else { %>protocol: '<%- answers.expEnvProtocol %>',<%}%>
55
- port: <%- answers.expEnvPort %>,
56
- path: '/wd/hub',
57
- <% } else if(answers.hostname && answers.port) { %>//
58
- // =====================
59
- // Server Configurations
60
- // =====================
61
- // Host address of the running Selenium server. This information is usually obsolete as
62
- // WebdriverIO automatically connects to localhost. Also, if you are using one of the
63
- // supported cloud services like Sauce Labs, Browserstack, Testing Bot or LambdaTest you don't
64
- // need to define host and port information because WebdriverIO can figure that out
65
- // according to your user and key information. However, if you are using a private Selenium
66
- // backend you should define the host address, port, and path here.
67
- //
68
- hostname: '<%- answers.hostname %>',
69
- port: <%- answers.port %>,
70
- path: '<%- answers.path %>',<% } else if (answers.services.includes('appium')) { %>
71
- port: 4723,<% }
72
-
73
- // Protocol: http | https
74
- // protocol: 'http',
75
- if(answers.env_user && answers.env_key) { %>
76
- //
77
- // =================
78
- // Service Providers
79
- // =================
80
- // WebdriverIO supports Sauce Labs, Browserstack, Testing Bot and LambdaTest (other cloud providers
81
- // should work too though). These services define specific user and key (or access key)
82
- // values you need to put in here in order to connect to these services.
83
- //
84
- user: process.env.<%- answers.env_user %>,
85
- key: process.env.<%- answers.env_key %>,
86
- //
87
- // If you run your tests on Sauce Labs you can specify the region you want to run your tests
88
- // in via the `region` property. Available short handles for regions are `us` (default), `eu` and `apac`.
89
- // These regions are used for the Sauce Labs VM cloud and the Sauce Labs Real Device Cloud.
90
- // If you don't provide the region it will default for the `us`
91
- <% }
92
- if(answers.headless) { %>headless: true,<% }
93
- if(answers.region) { %>region: '<%- answers.region %>',<% } %>
94
- //
95
- // ==================
96
- // Specify Test Files
97
- // ==================
98
- // Define which test specs should run. The pattern is relative to the directory
99
- // of the configuration file being run.
100
- //
101
- // The specs are defined as an array of spec files (optionally using wildcards
102
- // that will be expanded). The test for each spec file will be run in a separate
103
- // worker process. In order to have a group of spec files run in the same worker
104
- // process simply enclose them in an array within the specs array.
105
- //
106
- // The path of the spec files will be resolved relative from the directory of
107
- // of the config file unless it's absolute.
108
- //
109
- specs: [
110
- <%- answers.specs ? `'${answers.specs}'` : '// ToDo: define location for spec files here' %>
111
- ],
112
- // Patterns to exclude.
113
- exclude: [
114
- // 'path/to/excluded/files'
115
- ],
116
- //
117
- // ============
118
- // Capabilities
119
- // ============
120
- // Define your capabilities here. WebdriverIO can run multiple capabilities at the same
121
- // time. Depending on the number of capabilities, WebdriverIO launches several test
122
- // sessions. Within your capabilities you can overwrite the spec and exclude options in
123
- // order to group specific specs to a specific capability.
124
- //
125
- // First, you can define how many instances should be started at the same time. Let's
126
- // say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
127
- // set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
128
- // files and you set maxInstances to 10, all spec files will get tested at the same time
129
- // and 30 processes will get spawned. The property handles how many capabilities
130
- // from the same test should run tests.
131
- //
132
- maxInstances: 10,
133
- //
134
- // If you have trouble getting all important capabilities together, check out the
135
- // Sauce Labs platform configurator - a great tool to configure your capabilities:
136
- // https://saucelabs.com/platform/platform-configurator
137
- //
138
- <%- include('snippets/capabilities', { answers }) %>
139
- //
140
- // ===================
141
- // Test Configurations
142
- // ===================
143
- // Define all options that are relevant for the WebdriverIO instance here
144
- //
145
- // Level of logging verbosity: trace | debug | info | warn | error | silent
146
- logLevel: 'info',
147
- //
148
- // Set specific log levels per logger
149
- // loggers:
150
- // - webdriver, webdriverio
151
- // - @wdio/browserstack-service, @wdio/devtools-service, @wdio/sauce-service
152
- // - @wdio/mocha-framework, @wdio/jasmine-framework
153
- // - @wdio/local-runner
154
- // - @wdio/sumologic-reporter
155
- // - @wdio/cli, @wdio/config, @wdio/utils
156
- // Level of logging verbosity: trace | debug | info | warn | error | silent
157
- // logLevels: {
158
- // webdriver: 'info',
159
- // '@wdio/appium-service': 'info'
160
- // },
161
- //
162
- // If you only want to run your tests until a specific amount of tests have failed use
163
- // bail (default is 0 - don't bail, run all tests).
164
- bail: 0,
165
- //
166
- // Set a base URL in order to shorten url command calls. If your `url` parameter starts
167
- // with `/`, the base url gets prepended, not including the path portion of your baseUrl.
168
- // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
169
- // gets prepended directly.
170
- // baseUrl: 'http://localhost:8080',
171
- //
172
- // Default timeout for all waitFor* commands.
173
- waitforTimeout: 10000,
174
- //
175
- // Default timeout in milliseconds for request
176
- // if browser driver or grid doesn't send response
177
- connectionRetryTimeout: 120000,
178
- //
179
- // Default request retries count
180
- connectionRetryCount: 3,
181
- //
182
- // Test runner services
183
- // Services take over a specific job you don't want to take care of. They enhance
184
- // your test setup with almost no effort. Unlike plugins, they don't add new
185
- // commands. Instead, they hook themselves up into the test process.
186
- <% if(answers.services.length) {
187
- %><%- include('snippets/services', { answers }) %><%
188
- } else {
189
- %>// services: [],
190
- //<% } %>
191
- // Framework you want to run your specs with.
192
- // The following are supported: Mocha, Jasmine, and Cucumber
193
- // see also: https://webdriver.io/docs/frameworks
194
- //
195
- // Make sure you have the wdio adapter package for the specific framework installed
196
- // before running any tests.
197
- framework: '<%- answers.framework %>',
198
- <%- answers.framework === '@serenity-js/webdriverio' ? include('snippets/serenity', { answers }) : '' %>
199
- //
200
- // The number of times to retry the entire specfile when it fails as a whole
201
- // specFileRetries: 1,
202
- //
203
- // Delay in seconds between the spec file retry attempts
204
- // specFileRetriesDelay: 0,
205
- //
206
- // Whether or not retried spec files should be retried immediately or deferred to the end of the queue
207
- // specFileRetriesDeferred: false,
208
- //
209
- <%- include('snippets/reporters', { reporters: answers.reporters })
210
- %><%- _.if([ answers.serenityAdapter, answers.framework ].includes('mocha'), include('snippets/mocha', { answers }))
211
- %><%- _.if([ answers.serenityAdapter, answers.framework ].includes('jasmine'), include('snippets/jasmine', { answers }))
212
- %><%- _.if([ answers.serenityAdapter, answers.framework ].includes('cucumber'), include('snippets/cucumber', { answers }))
213
- %>
214
- //
215
- // =====
216
- // Hooks
217
- // =====
218
- // WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
219
- // it and to build services around it. You can either apply a single function or an array of
220
- // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
221
- // resolved to continue.
222
- /**
223
- * Gets executed once before all workers get launched.
224
- * @param {object} config wdio configuration object
225
- * @param {Array.<Object>} capabilities list of capabilities details
226
- */
227
- // onPrepare: function (config, capabilities) {
228
- // },
229
- /**
230
- * Gets executed before a worker process is spawned and can be used to initialize specific service
231
- * for that worker as well as modify runtime environments in an async fashion.
232
- * @param {string} cid capability id (e.g 0-0)
233
- * @param {object} caps object containing capabilities for session that will be spawn in the worker
234
- * @param {object} specs specs to be run in the worker process
235
- * @param {object} args object that will be merged with the main configuration once worker is initialized
236
- * @param {object} execArgv list of string arguments passed to the worker process
237
- */
238
- // onWorkerStart: function (cid, caps, specs, args, execArgv) {
239
- // },
240
- /**
241
- * Gets executed just after a worker process has exited.
242
- * @param {string} cid capability id (e.g 0-0)
243
- * @param {number} exitCode 0 - success, 1 - fail
244
- * @param {object} specs specs to be run in the worker process
245
- * @param {number} retries number of retries used
246
- */
247
- // onWorkerEnd: function (cid, exitCode, specs, retries) {
248
- // },
249
- /**
250
- * Gets executed just before initialising the webdriver session and test framework. It allows you
251
- * to manipulate configurations depending on the capability or spec.
252
- * @param {object} config wdio configuration object
253
- * @param {Array.<Object>} capabilities list of capabilities details
254
- * @param {Array.<String>} specs List of spec file paths that are to be run
255
- * @param {string} cid worker id (e.g. 0-0)
256
- */
257
- // beforeSession: function (config, capabilities, specs, cid) {
258
- // },
259
- /**
260
- * Gets executed before test execution begins. At this point you can access to all global
261
- * variables like `browser`. It is the perfect place to define custom commands.
262
- * @param {Array.<Object>} capabilities list of capabilities details
263
- * @param {Array.<String>} specs List of spec file paths that are to be run
264
- * @param {object} browser instance of created browser/device session
265
- */
266
- // before: function (capabilities, specs) {
267
- // },
268
- /**
269
- * Runs before a WebdriverIO command gets executed.
270
- * @param {string} commandName hook command name
271
- * @param {Array} args arguments that command would receive
272
- */
273
- // beforeCommand: function (commandName, args) {
274
- // },<%
275
- if(answers.framework === 'mocha' || answers.framework === 'jasmine') { %>
276
- /**
277
- * Hook that gets executed before the suite starts
278
- * @param {object} suite suite details
279
- */
280
- // beforeSuite: function (suite) {
281
- // },
282
- /**
283
- * Function to be executed before a test (in Mocha/Jasmine) starts.
284
- */
285
- // beforeTest: function (test, context) {
286
- // },
287
- /**
288
- * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
289
- * beforeEach in Mocha)
290
- */
291
- // beforeHook: function (test, context, hookName) {
292
- // },
293
- /**
294
- * Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling
295
- * afterEach in Mocha)
296
- */
297
- // afterHook: function (test, context, { error, result, duration, passed, retries }, hookName) {
298
- // },
299
- <%- include('snippets/afterTest', { reporters: answers.reporters }) %>
300
- /**
301
- * Hook that gets executed after the suite has ended
302
- * @param {object} suite suite details
303
- */
304
- // afterSuite: function (suite) {
305
- // },<% }
306
- if(answers.framework === 'cucumber') { %>
307
- /**
308
- * Cucumber Hooks
309
- *
310
- * Runs before a Cucumber Feature.
311
- * @param {string} uri path to feature file
312
- * @param {GherkinDocument.IFeature} feature Cucumber feature object
313
- */
314
- // beforeFeature: function (uri, feature) {
315
- // },
316
- /**
317
- *
318
- * Runs before a Cucumber Scenario.
319
- * @param {ITestCaseHookParameter} world world object containing information on pickle and test step
320
- * @param {object} context Cucumber World object
321
- */
322
- // beforeScenario: function (world, context) {
323
- // },
324
- /**
325
- *
326
- * Runs before a Cucumber Step.
327
- * @param {Pickle.IPickleStep} step step data
328
- * @param {IPickle} scenario scenario pickle
329
- * @param {object} context Cucumber World object
330
- */
331
- // beforeStep: function (step, scenario, context) {
332
- // },
333
- /**
334
- *
335
- * Runs after a Cucumber Step.
336
- * @param {Pickle.IPickleStep} step step data
337
- * @param {IPickle} scenario scenario pickle
338
- * @param {object} result results object containing scenario results
339
- * @param {boolean} result.passed true if scenario has passed
340
- * @param {string} result.error error stack if scenario failed
341
- * @param {number} result.duration duration of scenario in milliseconds
342
- * @param {object} context Cucumber World object
343
- */
344
- // afterStep: function (step, scenario, result, context) {
345
- // },
346
- /**
347
- *
348
- * Runs after a Cucumber Scenario.
349
- * @param {ITestCaseHookParameter} world world object containing information on pickle and test step
350
- * @param {object} result results object containing scenario results
351
- * @param {boolean} result.passed true if scenario has passed
352
- * @param {string} result.error error stack if scenario failed
353
- * @param {number} result.duration duration of scenario in milliseconds
354
- * @param {object} context Cucumber World object
355
- */
356
- // afterScenario: function (world, result, context) {
357
- // },
358
- /**
359
- *
360
- * Runs after a Cucumber Feature.
361
- * @param {string} uri path to feature file
362
- * @param {GherkinDocument.IFeature} feature Cucumber feature object
363
- */
364
- // afterFeature: function (uri, feature) {
365
- // },
366
- <% } %>
367
- /**
368
- * Runs after a WebdriverIO command gets executed
369
- * @param {string} commandName hook command name
370
- * @param {Array} args arguments that command would receive
371
- * @param {number} result 0 - command success, 1 - command error
372
- * @param {object} error error object if any
373
- */
374
- // afterCommand: function (commandName, args, result, error) {
375
- // },
376
- /**
377
- * Gets executed after all tests are done. You still have access to all global variables from
378
- * the test.
379
- * @param {number} result 0 - test pass, 1 - test fail
380
- * @param {Array.<Object>} capabilities list of capabilities details
381
- * @param {Array.<String>} specs List of spec file paths that ran
382
- */
383
- // after: function (result, capabilities, specs) {
384
- // },
385
- /**
386
- * Gets executed right after terminating the webdriver session.
387
- * @param {object} config wdio configuration object
388
- * @param {Array.<Object>} capabilities list of capabilities details
389
- * @param {Array.<String>} specs List of spec file paths that ran
390
- */
391
- // afterSession: function (config, capabilities, specs) {
392
- // },
393
- /**
394
- * Gets executed after all workers got shut down and the process is about to exit. An error
395
- * thrown in the onComplete hook will result in the test run failing.
396
- * @param {object} exitCode 0 - success, 1 - fail
397
- * @param {object} config wdio configuration object
398
- * @param {Array.<Object>} capabilities list of capabilities details
399
- * @param {<Object>} results object containing test results
400
- */
401
- // onComplete: function(exitCode, config, capabilities, results) {
402
- // },
403
- /**
404
- * Gets executed when a refresh happens.
405
- * @param {string} oldSessionId session ID of the old session
406
- * @param {string} newSessionId session ID of the new session
407
- */
408
- // onReload: function(oldSessionId, newSessionId) {
409
- // }
410
- /**
411
- * Hook that gets executed before a WebdriverIO assertion happens.
412
- * @param {object} params information about the assertion to be executed
413
- */
414
- // beforeAssertion: function(params) {
415
- // }
416
- /**
417
- * Hook that gets executed after a WebdriverIO assertion happened.
418
- * @param {object} params information about the assertion that was executed, including its results
419
- */
420
- // afterAssertion: function(params) {
421
- // }
422
- }
package/build/types.js DELETED
@@ -1 +0,0 @@
1
- export {};