@wdio/cli 7.16.3 → 7.16.7

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.
@@ -1,3 +1,5 @@
1
+ <%- isUsingTypeScript ? "import { ChainablePromiseElement } from 'webdriverio';" : "" %>
2
+
1
3
  <%- isUsingTypeScript || isUsingBabel
2
4
  ? "import Page from './page';"
3
5
  : "const Page = require('./page');" %>
@@ -9,26 +11,34 @@ class LoginPage extends Page {
9
11
  /**
10
12
  * define selectors using getter methods
11
13
  */
12
- get inputUsername () { return $('#username') }
13
- get inputPassword () { return $('#password') }
14
- get btnSubmit () { return $('button[type="submit"]') }
14
+ <%- isUsingTypeScript ? "public " : "" %>get inputUsername()<%- isUsingTypeScript ? ": ChainablePromiseElement<Promise<WebdriverIO.Element>>" : "" %> {
15
+ return $('#username');
16
+ }
17
+
18
+ <%- isUsingTypeScript ? "public " : "" %>get inputPassword()<%- isUsingTypeScript ? ": ChainablePromiseElement<Promise<WebdriverIO.Element>>" : "" %> {
19
+ return $('#password');
20
+ }
21
+
22
+ <%- isUsingTypeScript ? "public " : "" %>get btnSubmit()<%- isUsingTypeScript ? ": ChainablePromiseElement<Promise<WebdriverIO.Element>>" : "" %> {
23
+ return $('button[type="submit"]');
24
+ }
15
25
 
16
26
  /**
17
27
  * a method to encapsule automation code to interact with the page
18
28
  * e.g. to login using username and password
19
29
  */
20
- async login (username<%= isUsingTypeScript ? ": string": "" %>, password<%= isUsingTypeScript ? ": string": "" %>) {
30
+ <%- isUsingTypeScript ? "public " : "" %>async login (username<%- isUsingTypeScript ? ": string": "" %>, password<%- isUsingTypeScript ? ": string": "" %>)<%- isUsingTypeScript ? ": Promise<void>" : "" %> {
21
31
  await this.inputUsername.setValue(username);
22
32
  await this.inputPassword.setValue(password);
23
33
  await this.btnSubmit.click();
24
34
  }
25
35
 
26
36
  /**
27
- * overwrite specifc options to adapt it to page object
37
+ * overwrite specific options to adapt it to page object
28
38
  */
29
- open () {
39
+ <%- isUsingTypeScript ? "public " : "" %>open()<%- isUsingTypeScript ? ": Promise<string>" : "" %> {
30
40
  return super.open('login');
31
41
  }
32
42
  }
33
43
 
34
- <%= isUsingTypeScript || isUsingBabel ? "export default": "module.exports =" %> new LoginPage();
44
+ <%- isUsingTypeScript || isUsingBabel ? "export default": "module.exports =" %> new LoginPage();
@@ -2,12 +2,12 @@
2
2
  * main page object containing all methods, selectors and functionality
3
3
  * that is shared across all page objects
4
4
  */
5
- <%= isUsingTypeScript || isUsingBabel ? "export default": "module.exports =" %> class Page {
5
+ <%- isUsingTypeScript || isUsingBabel ? "export default" : "module.exports =" %> class Page {
6
6
  /**
7
7
  * Opens a sub page of the page
8
8
  * @param path path of the sub page (e.g. /path/to/page.html)
9
9
  */
10
- open (path<%= isUsingTypeScript ? ": string": "" %>) {
10
+ <%- isUsingTypeScript ? "public " : "" %>open(path<%- isUsingTypeScript ? ": string" : "" %>)<%- isUsingTypeScript ? ": Promise<string>" : "" %> {
11
11
  return browser.url(`https://the-internet.herokuapp.com/${path}`)
12
12
  }
13
13
  }
@@ -1,3 +1,5 @@
1
+ <%- isUsingTypeScript ? "import { ChainablePromiseElement } from 'webdriverio';" : "" %>
2
+
1
3
  <%- isUsingTypeScript || isUsingBabel
2
4
  ? "import Page from './page';"
3
5
  : "const Page = require('./page');" %>
@@ -9,7 +11,9 @@ class SecurePage extends Page {
9
11
  /**
10
12
  * define selectors using getter methods
11
13
  */
12
- get flashAlert () { return $('#flash') }
14
+ <%- isUsingTypeScript ? "public " : "" %>get flashAlert()<%- isUsingTypeScript ? ": ChainablePromiseElement<Promise<WebdriverIO.Element>>" : "" %> {
15
+ return $('#flash');
16
+ }
13
17
  }
14
18
 
15
- <%= isUsingTypeScript || isUsingBabel ? "export default": "module.exports =" %> new SecurePage();
19
+ <%- isUsingTypeScript || isUsingBabel ? "export default": "module.exports =" %> new SecurePage();
@@ -6,11 +6,11 @@
6
6
  //<%
7
7
 
8
8
  if(answers.expEnvAccessKey){ %>
9
- hostname: '<%= answers.expEnvHostname %>',
9
+ hostname: '<%- answers.expEnvHostname %>',
10
10
  <% if (answers.expEnvPort === '443'){%>protocol: 'https',
11
11
  <%} else if (answers.expEnvPort === '80'){%>protocol: 'http',
12
- <%} else { %>protocol: '<%= answers.expEnvProtocol %>',<%}%>
13
- port: <%= answers.expEnvPort %>,
12
+ <%} else { %>protocol: '<%- answers.expEnvProtocol %>',<%}%>
13
+ port: <%- answers.expEnvPort %>,
14
14
  path: '/wd/hub',
15
15
  <% } else if(answers.hostname && answers.port) { %>
16
16
  //
@@ -24,9 +24,9 @@
24
24
  // according to your user and key information. However, if you are using a private Selenium
25
25
  // backend you should define the host address, port, and path here.
26
26
  //
27
- hostname: '<%= answers.hostname %>',
28
- port: <%= answers.port %>,
29
- path: '<%= answers.path %>',<% } else if (answers.services.includes('appium')) { %>
27
+ hostname: '<%- answers.hostname %>',
28
+ port: <%- answers.port %>,
29
+ path: '<%- answers.path %>',<% } else if (answers.services.includes('appium')) { %>
30
30
  port: 4723,<% }
31
31
 
32
32
  // Protocol: http | https
@@ -40,8 +40,8 @@
40
40
  // should work too though). These services define specific user and key (or access key)
41
41
  // values you need to put in here in order to connect to these services.
42
42
  //
43
- user: process.env.<%= answers.env_user %>,
44
- key: process.env.<%= answers.env_key %>,
43
+ user: process.env.<%- answers.env_user %>,
44
+ key: process.env.<%- answers.env_key %>,
45
45
  //
46
46
  // If you run your tests on Sauce Labs you can specify the region you want to run your tests
47
47
  // in via the `region` property. Available short handles for regions are `us` (default), `eu` and `apac`.
@@ -49,7 +49,7 @@
49
49
  // If you don't provide the region it will default for the `us`
50
50
  <% }
51
51
  if(answers.headless) { %>headless: true,<% }
52
- if(answers.region) { %>region: '<%= answers.region %>',<% } %>
52
+ if(answers.region) { %>region: '<%- answers.region %>',<% } %>
53
53
  //
54
54
  // ==================
55
55
  // Specify Test Files
@@ -67,7 +67,7 @@
67
67
  // will be called from there.
68
68
  //
69
69
  specs: [
70
- '<%= answers.specs %>'
70
+ '<%- answers.specs %>'
71
71
  ],
72
72
  // Patterns to exclude.
73
73
  exclude: [
@@ -96,7 +96,7 @@
96
96
  // https://saucelabs.com/platform/platform-configurator
97
97
  //
98
98
  capabilities: [{
99
- <%if(answers.expEnvAccessKey){%> 'experitest:accessKey': '<%= answers.expEnvAccessKey %>',<%}%>
99
+ <%if(answers.expEnvAccessKey){%> 'experitest:accessKey': '<%- answers.expEnvAccessKey %>',<%}%>
100
100
  // maxInstances can get overwritten per capability. So if you have an in-house Selenium
101
101
  // grid with only 5 firefox instances available you can make sure that not more than
102
102
  // 5 instances get started at a time.
@@ -140,7 +140,7 @@
140
140
  // with `/`, the base url gets prepended, not including the path portion of your baseUrl.
141
141
  // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
142
142
  // gets prepended directly.
143
- baseUrl: '<%= answers.baseUrl %>',
143
+ baseUrl: '<%- answers.baseUrl %>',
144
144
  //
145
145
  // Default timeout for all waitFor* commands.
146
146
  waitforTimeout: 10000,
@@ -167,7 +167,7 @@
167
167
  //
168
168
  // Make sure you have the wdio adapter package for the specific framework installed
169
169
  // before running any tests.
170
- framework: '<%= answers.framework %>',
170
+ framework: '<%- answers.framework %>',
171
171
  //
172
172
  // The number of times to retry the entire specfile when it fails as a whole
173
173
  // specFileRetries: 1,
@@ -207,7 +207,7 @@
207
207
  // If you are using Cucumber you need to specify the location of your step definitions.
208
208
  cucumberOpts: {
209
209
  // <string[]> (file/dir) require files before executing features
210
- require: ['<%= answers.stepDefinitions %>'],
210
+ require: ['<%- answers.stepDefinitions %>'],
211
211
  // <boolean> show full backtrace for errors
212
212
  backtrace: false,
213
213
  // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
@@ -330,40 +330,44 @@
330
330
  /**
331
331
  *
332
332
  * Runs before a Cucumber Scenario.
333
- * @param {ITestCaseHookParameter} world world object containing information on pickle and test step
333
+ * @param {ITestCaseHookParameter} world world object containing information on pickle and test step
334
+ * @param {Object} context Cucumber World object
334
335
  */
335
- // beforeScenario: function (world) {
336
+ // beforeScenario: function (world, context) {
336
337
  // },
337
338
  /**
338
339
  *
339
340
  * Runs before a Cucumber Step.
340
341
  * @param {Pickle.IPickleStep} step step data
341
342
  * @param {IPickle} scenario scenario pickle
343
+ * @param {Object} context Cucumber World object
342
344
  */
343
- // beforeStep: function (step, scenario) {
345
+ // beforeStep: function (step, scenario, context) {
344
346
  // },
345
347
  /**
346
348
  *
347
349
  * Runs after a Cucumber Step.
348
- * @param {Pickle.IPickleStep} step step data
349
- * @param {IPickle} scenario scenario pickle
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
350
+ * @param {Pickle.IPickleStep} step step data
351
+ * @param {IPickle} scenario scenario pickle
352
+ * @param {Object} result results object containing scenario results
353
+ * @param {boolean} result.passed true if scenario has passed
354
+ * @param {string} result.error error stack if scenario failed
355
+ * @param {number} result.duration duration of scenario in milliseconds
356
+ * @param {Object} context Cucumber World object
354
357
  */
355
- // afterStep: function (step, scenario, result) {
358
+ // afterStep: function (step, scenario, result, context) {
356
359
  // },
357
360
  /**
358
361
  *
359
- * Runs before a Cucumber Scenario.
360
- * @param {ITestCaseHookParameter} world world object containing information on pickle and test step
361
- * @param {Object} result results object containing scenario results
362
- * @param {boolean} result.passed true if scenario has passed
363
- * @param {string} result.error error stack if scenario failed
364
- * @param {number} result.duration duration of scenario in milliseconds
362
+ * Runs after a Cucumber Scenario.
363
+ * @param {ITestCaseHookParameter} world world object containing information on pickle and test step
364
+ * @param {Object} result results object containing scenario results
365
+ * @param {boolean} result.passed true if scenario has passed
366
+ * @param {string} result.error error stack if scenario failed
367
+ * @param {number} result.duration duration of scenario in milliseconds
368
+ * @param {Object} context Cucumber World object
365
369
  */
366
- // afterScenario: function (world, result) {
370
+ // afterScenario: function (world, result, context) {
367
371
  // },
368
372
  /**
369
373
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/cli",
3
- "version": "7.16.3",
3
+ "version": "7.16.7",
4
4
  "description": "WebdriverIO testrunner command line interface",
5
5
  "author": "Christian Bromann <christian@saucelabs.com>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-cli",
@@ -53,7 +53,7 @@
53
53
  "lodash.union": "^4.6.0",
54
54
  "mkdirp": "^1.0.4",
55
55
  "recursive-readdir": "^2.2.2",
56
- "webdriverio": "7.16.3",
56
+ "webdriverio": "7.16.7",
57
57
  "yargs": "^17.0.0",
58
58
  "yarn-install": "^1.0.0"
59
59
  },
@@ -61,5 +61,5 @@
61
61
  "access": "public"
62
62
  },
63
63
  "types": "./build/index.d.ts",
64
- "gitHead": "23e2af933060e829f03d7518089c377571c654e3"
64
+ "gitHead": "6c51be2984c51b4442cc185e2fe4579179c6da03"
65
65
  }