@wdio/cli 7.16.2 → 7.16.6
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/build/templates/afterTest.ejs +8 -1
- package/build/templates/exampleFiles/pageobjects/login.page.js.ejs +16 -6
- package/build/templates/exampleFiles/pageobjects/page.js.ejs +2 -2
- package/build/templates/exampleFiles/pageobjects/secure.page.js.ejs +5 -1
- package/build/templates/wdio.conf.tpl.ejs +22 -18
- package/package.json +6 -6
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Function to be executed after a test (in Mocha/Jasmine)
|
|
2
|
+
* Function to be executed after a test (in Mocha/Jasmine only)
|
|
3
|
+
* @param {Object} test test object
|
|
4
|
+
* @param {Object} context scope object the test was executed with
|
|
5
|
+
* @param {Error} result.error error object in case the test fails, otherwise `undefined`
|
|
6
|
+
* @param {Any} result.result return object of test function
|
|
7
|
+
* @param {Number} result.duration duration of test
|
|
8
|
+
* @param {Boolean} result.passed true if test has passed, otherwise false
|
|
9
|
+
* @param {Object} result.retries informations to spec related retries, e.g. `{ attempts: 0, limit: 0 }`
|
|
3
10
|
*/<%
|
|
4
11
|
if (reporters.length && reporters.includes('allure')) {%>
|
|
5
12
|
afterTest: async function(test, context, { error, result, duration, passed, retries }) {
|
|
@@ -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,24 +11,32 @@ class LoginPage extends Page {
|
|
|
9
11
|
/**
|
|
10
12
|
* define selectors using getter methods
|
|
11
13
|
*/
|
|
12
|
-
get inputUsername
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
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
|
}
|
|
@@ -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
|
|
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
|
|
14
|
+
<%= isUsingTypeScript ? "public " : "" %>get flashAlert()<%= isUsingTypeScript ? ": ChainablePromiseElement<Promise<WebdriverIO.Element>>" : "" %> {
|
|
15
|
+
return $('#flash');
|
|
16
|
+
}
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
<%= isUsingTypeScript || isUsingBabel ? "export default": "module.exports =" %> new SecurePage();
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
//
|
|
94
94
|
// If you have trouble getting all important capabilities together, check out the
|
|
95
95
|
// Sauce Labs platform configurator - a great tool to configure your capabilities:
|
|
96
|
-
// https://
|
|
96
|
+
// https://saucelabs.com/platform/platform-configurator
|
|
97
97
|
//
|
|
98
98
|
capabilities: [{
|
|
99
99
|
<%if(answers.expEnvAccessKey){%> 'experitest:accessKey': '<%= answers.expEnvAccessKey %>',<%}%>
|
|
@@ -330,40 +330,44 @@
|
|
|
330
330
|
/**
|
|
331
331
|
*
|
|
332
332
|
* Runs before a Cucumber Scenario.
|
|
333
|
-
* @param {ITestCaseHookParameter} world
|
|
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
|
|
349
|
-
* @param {IPickle} scenario
|
|
350
|
-
* @param {Object} result
|
|
351
|
-
* @param {boolean} result.passed
|
|
352
|
-
* @param {string} result.error
|
|
353
|
-
* @param {number} result.duration
|
|
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
|
|
360
|
-
* @param {ITestCaseHookParameter} world
|
|
361
|
-
* @param {Object} result
|
|
362
|
-
* @param {boolean} result.passed
|
|
363
|
-
* @param {string} result.error
|
|
364
|
-
* @param {number} result.duration
|
|
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
|
+
"version": "7.16.6",
|
|
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",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"@types/lodash.union": "^4.6.6",
|
|
38
38
|
"@types/node": "^16.11.1",
|
|
39
39
|
"@types/recursive-readdir": "^2.2.0",
|
|
40
|
-
"@wdio/config": "7.16.
|
|
40
|
+
"@wdio/config": "7.16.3",
|
|
41
41
|
"@wdio/logger": "7.16.0",
|
|
42
|
-
"@wdio/types": "7.16.
|
|
43
|
-
"@wdio/utils": "7.16.
|
|
42
|
+
"@wdio/types": "7.16.3",
|
|
43
|
+
"@wdio/utils": "7.16.3",
|
|
44
44
|
"async-exit-hook": "^2.0.1",
|
|
45
45
|
"chalk": "^4.0.0",
|
|
46
46
|
"chokidar": "^3.0.0",
|
|
@@ -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.
|
|
56
|
+
"webdriverio": "7.16.6",
|
|
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": "
|
|
64
|
+
"gitHead": "3c4691df750c120c1b05d168d1b50bf047512892"
|
|
65
65
|
}
|