webdriverio 4.10.1 → 4.10.2
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/CHANGELOG.md +6 -0
- package/build/lib/cli.js +1 -1
- package/build/lib/commands/touchAction.js +10 -2
- package/build/lib/helpers/utilities.js +1 -1
- package/build/lib/helpers/wdio.conf.ejs +2 -2
- package/build/package.json +1 -1
- package/docs/guide/getstarted/configuration.md +1 -1
- package/docs/guide/reporters/allure.md +1 -1
- package/docs/guide/reporters/dot.md +1 -1
- package/docs/guide/services/docker.md +145 -0
- package/docs/guide/testrunner/configurationfile.md +2 -2
- package/docs/guide/testrunner/organizesuite.md +2 -0
- package/docs/guide/testrunner/reporters.md +2 -0
- package/docs/guide.md +2 -1
- package/lib/commands/touchAction.js +10 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/build/lib/cli.js
CHANGED
|
@@ -57,7 +57,7 @@ var SUPPORTED_FRAMEWORKS = ['mocha', // https://github.com/webdriverio/wdio-moch
|
|
|
57
57
|
'cucumber' // https://github.com/webdriverio/wdio-cucumber-framework
|
|
58
58
|
];
|
|
59
59
|
var SUPPORTED_REPORTER = [' dot - https://github.com/webdriverio/wdio-dot-reporter', ' spec - https://github.com/webdriverio/wdio-spec-reporter', ' junit - https://github.com/webdriverio/wdio-junit-reporter', ' allure - https://github.com/webdriverio/wdio-allure-reporter', ' teamcity - https://github.com/sullenor/wdio-teamcity-reporter', ' json - https://github.com/fijijavis/wdio-json-reporter', ' concise - https://github.com/FloValence/wdio-concise-reporter', ' testrail - https://github.com/oxynade/wdio-testrail-reporter', ' mochawesome - https://github.com/fijijavis/wdio-mochawesome-reporter'];
|
|
60
|
-
var SUPPORTED_SERVICES = [' sauce - https://github.com/webdriverio/wdio-sauce-service', ' browserstack - https://github.com/itszero/wdio-browserstack-service', ' testingbot - https://github.com/testingbot/wdio-testingbot-service', ' appium - https://github.com/rhysd/wdio-appium-service', ' firefox-profile - https://github.com/webdriverio/wdio-firefox-profile-service', ' selenium-standalone - https://github.com/webdriverio/wdio-selenium-standalone-service', ' phantomjs - https://github.com/cognitom/wdio-phantomjs-service', ' static-server - https://github.com/LeadPages/wdio-static-server-service', ' visual-regression - https://github.com/zinserjan/wdio-visual-regression-service', ' webpack - https://github.com/leadpages/wdio-webpack-service', ' webpack-dev-server - https://gitlab.com/Vinnl/wdio-webpack-dev-server-service', ' chromedriver - https://github.com/atti187/wdio-chromedriver-service', ' iedriver - https://github.com/atti187/wdio-iedriver-service'];
|
|
60
|
+
var SUPPORTED_SERVICES = [' sauce - https://github.com/webdriverio/wdio-sauce-service', ' browserstack - https://github.com/itszero/wdio-browserstack-service', ' testingbot - https://github.com/testingbot/wdio-testingbot-service', ' appium - https://github.com/rhysd/wdio-appium-service', ' firefox-profile - https://github.com/webdriverio/wdio-firefox-profile-service', ' selenium-standalone - https://github.com/webdriverio/wdio-selenium-standalone-service', ' phantomjs - https://github.com/cognitom/wdio-phantomjs-service', ' static-server - https://github.com/LeadPages/wdio-static-server-service', ' visual-regression - https://github.com/zinserjan/wdio-visual-regression-service', ' webpack - https://github.com/leadpages/wdio-webpack-service', ' webpack-dev-server - https://gitlab.com/Vinnl/wdio-webpack-dev-server-service', ' chromedriver - https://github.com/atti187/wdio-chromedriver-service', ' iedriver - https://github.com/atti187/wdio-iedriver-service', ' docker - https://github.com/stsvilik/wdio-docker-service'];
|
|
61
61
|
|
|
62
62
|
var VERSION = _package2.default.version;
|
|
63
63
|
var ALLOWED_ARGV = ['host', 'port', 'path', 'user', 'key', 'logLevel', 'coloredLogs', 'screenshotPath', 'baseUrl', 'waitforTimeout', 'framework', 'reporters', 'suite', 'spec', 'cucumberOpts', 'jasmineOpts', 'mochaOpts', 'connectionRetryTimeout', 'connectionRetryCount', 'watch'];
|
|
@@ -67,12 +67,20 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
67
67
|
'release'
|
|
68
68
|
])
|
|
69
69
|
|
|
70
|
+
// multi action using x y variables
|
|
71
|
+
// moveTo location is relative from the starting coordinate
|
|
72
|
+
browser.touchAction([
|
|
73
|
+
{ action: 'press', x: 20, y: 550 },
|
|
74
|
+
{ action: 'moveTo', x: 0, y: -500},
|
|
75
|
+
'release'
|
|
76
|
+
])
|
|
77
|
+
|
|
70
78
|
// drag&drop to element
|
|
71
79
|
screen.touchAction([
|
|
72
80
|
'press',
|
|
73
81
|
{ action: 'moveTo', selector: '//UIAApplication[1]/UIAElement[2]' },
|
|
74
82
|
'release'
|
|
75
|
-
])
|
|
83
|
+
])
|
|
76
84
|
});
|
|
77
85
|
|
|
78
86
|
:multiTouchAction.js
|
|
@@ -80,7 +88,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
80
88
|
// drag&drop with two fingers 200px down
|
|
81
89
|
browser.touchAction([
|
|
82
90
|
[{action: 'press', x: 10, y: 10}, { action: 'moveTo', x: 0, y: 200 }, 'release'],
|
|
83
|
-
[{action: 'press', x: 100, y: 10}, { action: 'moveTo', x: 0, y: 200 }, 'release']
|
|
91
|
+
[{action: 'press', x: 100, y: 10}, { action: 'moveTo', x: 0, y: 200 }, 'release']
|
|
84
92
|
])
|
|
85
93
|
})
|
|
86
94
|
* </example>
|
|
@@ -62,7 +62,7 @@ function isUnknownCommand(err) {
|
|
|
62
62
|
/**
|
|
63
63
|
* when running browser driver directly
|
|
64
64
|
*/
|
|
65
|
-
if (err.message.match(/Invalid Command Method/) || err.message.match(/did not match a known command/) || err.message.match(/unknown command/) || err.message.match(/Driver info: driver\.version: unknown/) || err.message.match(/did not map to a valid resource/)) {
|
|
65
|
+
if (err.message.match(/Invalid Command Method/) || err.message.match(/did not match a known command/) || err.message.match(/unknown command/) || err.message.match(/Driver info: driver\.version: unknown/) || err.message.match(/Method has not yet been implemented/) || err.message.match(/did not map to a valid resource/)) {
|
|
66
66
|
return true;
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -273,13 +273,13 @@ exports.config = {
|
|
|
273
273
|
// beforeHook: function () {
|
|
274
274
|
// },
|
|
275
275
|
/**
|
|
276
|
-
* Hook that gets executed _after_ a hook within the suite
|
|
276
|
+
* Hook that gets executed _after_ a hook within the suite ends (e.g. runs after calling
|
|
277
277
|
* afterEach in Mocha)
|
|
278
278
|
*/
|
|
279
279
|
// afterHook: function () {
|
|
280
280
|
// },
|
|
281
281
|
/**
|
|
282
|
-
* Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber)
|
|
282
|
+
* Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) ends.
|
|
283
283
|
* @param {Object} test test details
|
|
284
284
|
*/
|
|
285
285
|
// afterTest: function (test) {
|
package/build/package.json
CHANGED
|
@@ -122,7 +122,7 @@ Type: `Boolean`<br>
|
|
|
122
122
|
Default: *true*
|
|
123
123
|
|
|
124
124
|
### bail
|
|
125
|
-
If you only want to run your tests until a specific amount of tests have failed use bail (default is 0 - don't bail, run all tests).
|
|
125
|
+
If you only want to run your tests until a specific amount of tests have failed use bail (default is 0 - don't bail, run all tests). _Note_: Please be aware that when using a third party test runner such as Mocha, additional configuration might be required.
|
|
126
126
|
|
|
127
127
|
Type: `Number`<br>
|
|
128
128
|
Default: *0* (don't bail, run all tests)
|
|
@@ -60,7 +60,7 @@ Apply and restart the Jenkins server. All assets should now be served correctly.
|
|
|
60
60
|
Install the [Allure command-line tool](https://www.npmjs.com/package/allure-commandline), and process the results directory:
|
|
61
61
|
|
|
62
62
|
```sh
|
|
63
|
-
$ allure generate [allure_output_dir] && allure
|
|
63
|
+
$ allure generate [allure_output_dir] && allure open
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
This will generate a report (by default in `./allure-report`), and open it in your browser:
|
|
@@ -8,7 +8,7 @@ title: WebdriverIO - Dot Reporter
|
|
|
8
8
|
Dot Reporter
|
|
9
9
|
============
|
|
10
10
|
|
|
11
|
-
The dot reporter is the default reporter for the WDIO test runner. It's
|
|
11
|
+
The dot reporter is the default reporter for the WDIO test runner. It's therefore a dependency of WebdriverIO and doesn't need to get downloaded. To use the dot reporter just add `'dot'` to the `reporters` array:
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
14
|
// wdio.conf.js
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
name: docker
|
|
2
|
+
category: services
|
|
3
|
+
tags: guide
|
|
4
|
+
index: 13
|
|
5
|
+
title: WebdriverIO - Docker Service
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Docker Service
|
|
9
|
+
===========================
|
|
10
|
+
|
|
11
|
+
This service allows user to seamlessly run test for/using a containerized application by utilizing a popular [Docker](https://www.docker.com/) service.
|
|
12
|
+
Currently it supports two modes of operation:
|
|
13
|
+
- using Docker to host Selenium (similar to Selenium Standalone Service)
|
|
14
|
+
- using Docker to run your containerized application
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
The easiest way is to keep `wdio-docker-service` as a devDependency in your `package.json`.
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"wdio-docker-service": "~1.x"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
You can simply do it by:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install wdio-docker-service --save-dev
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Configuration
|
|
35
|
+
|
|
36
|
+
By default, Google Chrome, Firefox and PhantomJS are available when installed on the host system. In order to use the service you need to add docker to your service array:
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
// wdio.conf.js
|
|
40
|
+
exports.config = {
|
|
41
|
+
// ...
|
|
42
|
+
services: ['docker'],
|
|
43
|
+
// ...
|
|
44
|
+
// Options are set here as well
|
|
45
|
+
dockerLogs: './logs',
|
|
46
|
+
dockerOptions: {
|
|
47
|
+
image: 'selenium/standalone-chrome',
|
|
48
|
+
healthCheck: 'http://localhost:4444',
|
|
49
|
+
options: {
|
|
50
|
+
p: ['4444:4444'],
|
|
51
|
+
shmSize: '2g'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//...
|
|
55
|
+
};
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Options
|
|
59
|
+
|
|
60
|
+
### dockerOptions
|
|
61
|
+
Various options required to run docker container
|
|
62
|
+
|
|
63
|
+
Type: `Object`
|
|
64
|
+
|
|
65
|
+
Default: `{
|
|
66
|
+
options: {
|
|
67
|
+
rm: true,
|
|
68
|
+
cidfile: [path to cidfile]
|
|
69
|
+
}
|
|
70
|
+
}`
|
|
71
|
+
|
|
72
|
+
Example:
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
dockerOptions: {
|
|
76
|
+
image: 'selenium/standalone-chrome',
|
|
77
|
+
healthCheck: 'http://localhost:4444',
|
|
78
|
+
options: {
|
|
79
|
+
p: ['4444:4444'],
|
|
80
|
+
shmSize: '2g'
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### dockerOptions.image
|
|
86
|
+
Docker container name tag. Could be local or from Docker HUB.
|
|
87
|
+
|
|
88
|
+
Type: `String`
|
|
89
|
+
|
|
90
|
+
Required: `true`
|
|
91
|
+
|
|
92
|
+
### dockerOptions.healthCheck
|
|
93
|
+
Url to an app exposed by your container. Normally this is a localhost url.
|
|
94
|
+
If healthCheck is not provided, Webdriver will start running tests immediately after Docker container is executed, which
|
|
95
|
+
maybe too early considering that it takes time for web service to start inside a Docker container.
|
|
96
|
+
|
|
97
|
+
Type: `String`
|
|
98
|
+
|
|
99
|
+
Example: `http://localhost:4444`
|
|
100
|
+
|
|
101
|
+
### dockerOptions.options
|
|
102
|
+
Map of options used by `docker run` command. For more details on `run` command click [here](https://docs.docker.com/edge/engine/reference/commandline/run/).
|
|
103
|
+
|
|
104
|
+
Any single-letter option will be converted to `-[option]` (i.e. `d: true` -> `-d`).
|
|
105
|
+
|
|
106
|
+
Any option of two-character or more will
|
|
107
|
+
be converted to `--[option]` (i.e. `rm: true` -> `--rm`).
|
|
108
|
+
|
|
109
|
+
For options that may be used more than once
|
|
110
|
+
(i.e. `-e`,`-add-host`, `--expose`, etc.), please use array notation (i.e. `e: ["NODE_ENV=development", "FOO=bar"]`).
|
|
111
|
+
|
|
112
|
+
Type: `Object`
|
|
113
|
+
|
|
114
|
+
Example:
|
|
115
|
+
|
|
116
|
+
```javascript
|
|
117
|
+
options: {
|
|
118
|
+
e: ['NODE_ENV=development', 'PROXY=http://myproxy:80']
|
|
119
|
+
p: ['4444:4444', '5900:5900'],
|
|
120
|
+
shmSize: '2g'
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### dockerOptions.args
|
|
125
|
+
Any arguments you may want to pass into container. Corresponds to `[ARG...]` in Docker run CLI.
|
|
126
|
+
|
|
127
|
+
Type: `String`
|
|
128
|
+
|
|
129
|
+
### dockerOptions.command
|
|
130
|
+
Any command you may want to pass into container. Corresponds to `[COMMAND]` in Docker run CLI.
|
|
131
|
+
|
|
132
|
+
Type: `String`
|
|
133
|
+
|
|
134
|
+
### onDockerReady
|
|
135
|
+
A callback method which is called when Docker application is ready. Readiness is determined by ability to ping `healthCheck` url.
|
|
136
|
+
|
|
137
|
+
Type: `Function`
|
|
138
|
+
|
|
139
|
+
### dockerLogs
|
|
140
|
+
Path to where logs from docker container should be stored
|
|
141
|
+
|
|
142
|
+
Type: `String`
|
|
143
|
+
|
|
144
|
+
## Testing Use Cases / Recipes
|
|
145
|
+
Please visit our [Wiki](https://github.com/stsvilik/wdio-docker-service/wiki) for more details.
|
|
@@ -279,7 +279,7 @@ exports.config = {
|
|
|
279
279
|
beforeHook: function () {
|
|
280
280
|
},
|
|
281
281
|
/**
|
|
282
|
-
* Hook that gets executed _after_ a hook within the suite
|
|
282
|
+
* Hook that gets executed _after_ a hook within the suite ends (e.g. runs after calling
|
|
283
283
|
* afterEach in Mocha)
|
|
284
284
|
*/
|
|
285
285
|
afterHook: function () {
|
|
@@ -307,7 +307,7 @@ exports.config = {
|
|
|
307
307
|
afterCommand: function (commandName, args, result, error) {
|
|
308
308
|
},
|
|
309
309
|
/**
|
|
310
|
-
* Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber)
|
|
310
|
+
* Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) ends.
|
|
311
311
|
* @param {Object} test test details
|
|
312
312
|
*/
|
|
313
313
|
afterTest: function (test) {
|
|
@@ -140,3 +140,5 @@ _**Note:** This will_ not _override the `--spec` flag for running a single spec.
|
|
|
140
140
|
## Stop testing after failure
|
|
141
141
|
|
|
142
142
|
With the `bail` option you can specify when WebdriverIO should stop the test run after test failures. This can be helpful when you have a big test suite and want to avoid long test runs when you already know that your build will break. The option expects a number that specifies after how many spec failures it should stop the whole test run. The default is `0` meaning that it always runs all tests specs it can find.
|
|
143
|
+
|
|
144
|
+
Please see http://webdriver.io/guide/getstarted/configuration.html#bail for additional information on the bail configuration.
|
|
@@ -56,6 +56,7 @@ You can register event handler for several events which get triggered during the
|
|
|
56
56
|
|
|
57
57
|
```txt
|
|
58
58
|
'start'
|
|
59
|
+
'runner:start'
|
|
59
60
|
'suite:start'
|
|
60
61
|
'hook:start'
|
|
61
62
|
'hook:end'
|
|
@@ -65,6 +66,7 @@ You can register event handler for several events which get triggered during the
|
|
|
65
66
|
'test:fail'
|
|
66
67
|
'test:pending'
|
|
67
68
|
'suite:end'
|
|
69
|
+
'runner:end'
|
|
68
70
|
'end'
|
|
69
71
|
```
|
|
70
72
|
|
package/docs/guide.md
CHANGED
|
@@ -43,9 +43,10 @@ $ curl -L https://github.com/mozilla/geckodriver/releases/download/v0.16.0/gecko
|
|
|
43
43
|
|
|
44
44
|
Note: Other geckodriver releases are available [here](https://github.com/mozilla/geckodriver/releases).
|
|
45
45
|
|
|
46
|
+
** 4. Start selenium standalone server**
|
|
47
|
+
|
|
46
48
|
Start the server by executing the following:
|
|
47
49
|
|
|
48
|
-
** 4. Start selenium standalone server**
|
|
49
50
|
```sh
|
|
50
51
|
$ java -jar -Dwebdriver.gecko.driver=./geckodriver selenium-server-standalone-3.5.3.jar
|
|
51
52
|
```
|
|
@@ -49,12 +49,20 @@
|
|
|
49
49
|
'release'
|
|
50
50
|
])
|
|
51
51
|
|
|
52
|
+
// multi action using x y variables
|
|
53
|
+
// moveTo location is relative from the starting coordinate
|
|
54
|
+
browser.touchAction([
|
|
55
|
+
{ action: 'press', x: 20, y: 550 },
|
|
56
|
+
{ action: 'moveTo', x: 0, y: -500},
|
|
57
|
+
'release'
|
|
58
|
+
])
|
|
59
|
+
|
|
52
60
|
// drag&drop to element
|
|
53
61
|
screen.touchAction([
|
|
54
62
|
'press',
|
|
55
63
|
{ action: 'moveTo', selector: '//UIAApplication[1]/UIAElement[2]' },
|
|
56
64
|
'release'
|
|
57
|
-
])
|
|
65
|
+
])
|
|
58
66
|
});
|
|
59
67
|
|
|
60
68
|
:multiTouchAction.js
|
|
@@ -62,7 +70,7 @@
|
|
|
62
70
|
// drag&drop with two fingers 200px down
|
|
63
71
|
browser.touchAction([
|
|
64
72
|
[{action: 'press', x: 10, y: 10}, { action: 'moveTo', x: 0, y: 200 }, 'release'],
|
|
65
|
-
[{action: 'press', x: 100, y: 10}, { action: 'moveTo', x: 0, y: 200 }, 'release']
|
|
73
|
+
[{action: 'press', x: 100, y: 10}, { action: 'moveTo', x: 0, y: 200 }, 'release']
|
|
66
74
|
])
|
|
67
75
|
})
|
|
68
76
|
* </example>
|
package/package.json
CHANGED