webdriverio 4.10.1 → 4.12.0
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 +24 -1
- package/GOVERNANCE.md +60 -0
- package/build/lib/cli.js +2 -3
- package/build/lib/commands/isVisibleWithinViewport.js +1 -1
- package/build/lib/commands/touchAction.js +10 -2
- package/build/lib/helpers/findElementStrategy.js +15 -3
- package/build/lib/helpers/sanitize.js +16 -5
- package/build/lib/helpers/utilities.js +1 -1
- package/build/lib/helpers/wdio.conf.ejs +2 -2
- package/build/lib/launcher.js +53 -14
- package/build/lib/protocol/log.js +15 -42
- package/build/lib/scripts/createSelectorScript.js +1 -1
- package/build/lib/utils/ConfigParser.js +2 -1
- package/build/lib/utils/RequestHandler.js +4 -1
- package/build/package.json +1 -2
- package/docs/guide/getstarted/configuration.md +33 -1
- package/docs/guide/reporters/allure.md +1 -1
- package/docs/guide/reporters/dot.md +1 -1
- package/docs/guide/reporters/mochawesome.md +1 -1
- package/docs/guide/services/docker.md +145 -0
- package/docs/guide/services/screenshots-cleanup.md +51 -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/usage/selectors.md +16 -0
- package/docs/guide.md +2 -1
- package/lib/commands/isVisibleWithinViewport.js +1 -1
- package/lib/commands/touchAction.js +10 -2
- package/lib/protocol/log.js +2 -21
- package/package-lock.json +1262 -991
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v4.12.0 (2018-03-07)
|
|
4
|
+
* global changes:
|
|
5
|
+
* docs improvements
|
|
6
|
+
* allow to set `proxy` and `agent` request options
|
|
7
|
+
* wdio changes:
|
|
8
|
+
* support for files with `.es6` ending
|
|
9
|
+
|
|
10
|
+
## v4.11.0 (2018-02-27)
|
|
11
|
+
* global changes:
|
|
12
|
+
* docs improvements
|
|
13
|
+
* Add new selector strategies from WebdriverAgent (#2613)
|
|
14
|
+
* bugfixes:
|
|
15
|
+
* isVisibleWithinViewport check fix if element is not existing (#2593)
|
|
16
|
+
* propagate `process.execArgv` correctly
|
|
17
|
+
* wdio changes:
|
|
18
|
+
* increase framework timeout if `--inspect` parameter is found in execArgv
|
|
19
|
+
|
|
20
|
+
## v4.10.2 (2018-02-02)
|
|
21
|
+
* global changes:
|
|
22
|
+
* docs improvements
|
|
23
|
+
* bugfixes:
|
|
24
|
+
* better unknown command detection (#2580)
|
|
25
|
+
|
|
3
26
|
## v4.10.1 (2018-01-12)
|
|
4
27
|
* bugfixes:
|
|
5
28
|
* fallback to old JSONWireProtocol commands when running Chromedriver
|
|
@@ -12,7 +35,7 @@
|
|
|
12
35
|
* global changes:
|
|
13
36
|
* docs improvements
|
|
14
37
|
* fallbacks for depcrecated JsonWireProtocol commands (#2493)
|
|
15
|
-
* wdio changes
|
|
38
|
+
* wdio changes:
|
|
16
39
|
* Add ability to specify a spec and suite (#2505)
|
|
17
40
|
* Add support for filtering specs #2520
|
|
18
41
|
|
package/GOVERNANCE.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# WebdriverIO Project Governance
|
|
2
|
+
|
|
3
|
+
The WebdriverIO Project wants as much as possible to operate using procedures that are fair, open, inviting, and ultimately good for the community. For that reason we find it valuable to codify some of the ways that the Project goes about its day-to-day business. We want to make sure that no matter who you are, you have the opportunity to contribute to WebdriverIO. We want to make sure that no one corporation can exert undue influence on the community or hold the Project hostage. And likewise we want to make sure that corporations which benefit from WebdriverIO are also incentivized to give back.
|
|
4
|
+
|
|
5
|
+
### The Technical Committee
|
|
6
|
+
|
|
7
|
+
The project is officially led by a Technical Committee (TC), currently
|
|
8
|
+
consisting of:
|
|
9
|
+
|
|
10
|
+
* [@bromann](https://github.com/christian-bromann)
|
|
11
|
+
* [@camme](https://github.com/camme)
|
|
12
|
+
* [@vvo](https://github.com/vvo)
|
|
13
|
+
* [@georgecrawford](https://github.com/georgecrawford)
|
|
14
|
+
|
|
15
|
+
They all represent different companies and different types of contribution to the WebdriverIO Project. The TC is responsible for high-level decisions (like establishing a feature roadmap, accepting sponsorship, organizing conferences, etc...), adjudicating conflicts between members of the community, and making changes to the project's governance processes.
|
|
16
|
+
|
|
17
|
+
* Membership in the TC is granted by unanimous vote of current TC members.
|
|
18
|
+
* TC members can step down at any time.
|
|
19
|
+
* No more than 1/3 of TC members may belong to the same company.
|
|
20
|
+
* Changes to project governance require unanimous vote of the TC.
|
|
21
|
+
|
|
22
|
+
### Project Committers
|
|
23
|
+
|
|
24
|
+
Most of the project maintenance is handled by committers, community members who have been granted commit access to the WebdriverIO organization on GitHub. The responsibilities of committers include: reviewing and merging pull requests, walking through changes with developers, weighing in on architectural issues, and so on.
|
|
25
|
+
|
|
26
|
+
* Any two TC members can decide to make someone a project committer, providing that person has shown an appropriate understanding of the WebdriverIO codebase through prior contributions of code.
|
|
27
|
+
* In general any committer can review and merge a PR. In general committers should only merge code they are qualified to review, which might entail pinging another committer who has greater ownership over a specific code area.
|
|
28
|
+
* Debates between committers about whether code should be merged should happen in GitHub pull requests.
|
|
29
|
+
* Proposals for large changes to the project's code (architectural changes, etc...) should be brought forward as a GitHub issue (with the label `Proposal`), and all committers should be pinged so they can weigh in on the discussion if desired. Substantial changes, whether in proposal stage or in pull request stage should be signed off on by 1 TC member and at least 2 other committers. To assist in the discussion, a small proof of concept can be undertaken on a subset of the WebdriverIO ecosystem and raised as a strawman PR, to give flesh to the proposal and make discussion more helpfully concrete.
|
|
30
|
+
* In general disputes about code should be resolved by discussion, not votes. If there is substantial disagreement, aim for consensus. If that is not possible, committers can bring the dispute to the TC for a vote, with the outcome determined by a majority.
|
|
31
|
+
* Any committer can decide to close a PR or issue if they determine the change doesn't suit the project.
|
|
32
|
+
* WebdriverIO has a large ecosystem of repositories. Some are 'core' in the sense of being central subpackages with a lot of traffic like `webdriverio/webdriverio`. Others are 'peripheral' in the sense of receiving few changes, being maintained by 1 person or no one, etc..., like `webdriverio/cucumber-boilerplate` or `webdriverio/jasmine-boilerplate`. For 'core' repos, committers should not merge their own code straightaway. Like all contributors they should open a PR and get a +1 from another committer. For 'peripheral' repos for which they are the sole maintainer or for which they have a good understanding, it is obtuse to insist on another contributor's +1 and this rule should be relaxed in that case. In sum: use good judgment and don't ram code through without a review when you can help it.
|
|
33
|
+
|
|
34
|
+
The current committers are (in addition to the TC members above):
|
|
35
|
+
|
|
36
|
+
* [@WillBrock](https://github.com/WillBrock)
|
|
37
|
+
* [@fijijavis](https://github.com/fijijavis)
|
|
38
|
+
* [@TuHuynhVan](https://github.com/TuHuynhVan)
|
|
39
|
+
* [@wvankuipers](https://github.com/wvankuipers)
|
|
40
|
+
* [@klamping](https://github.com/klamping)
|
|
41
|
+
* [@zinserjan](https://github.com/zinserjan)
|
|
42
|
+
* [@TheSavior](https://github.com/TheSavior)
|
|
43
|
+
* [@lgandecki](https://github.com/lgandecki)
|
|
44
|
+
* [@jankcat](https://github.com/jankcat)
|
|
45
|
+
* [@amitaibu](https://github.com/amitaibu)
|
|
46
|
+
* [@ThomasFett](https://github.com/ThomasFett)
|
|
47
|
+
* [@moizjv](https://github.com/moizjv)
|
|
48
|
+
|
|
49
|
+
### Contributors
|
|
50
|
+
|
|
51
|
+
Other, less formal, kinds of contribution are outlined in our
|
|
52
|
+
[CONTRIBUTING](/CONTRIBUTING.md) doc.
|
|
53
|
+
|
|
54
|
+
### Sponsorship
|
|
55
|
+
|
|
56
|
+
The WebdriverIO project welcomes sponsorship of various organizations. Specific details are not yet available but in general we will accept monetary donations, contribution of code, contribution of dedicated committers, or donations of other goods or service (internet hosting, etc...). To begin the conversation, reach out to one of the TC members.
|
|
57
|
+
|
|
58
|
+
### Raising Issues Related to Governance
|
|
59
|
+
|
|
60
|
+
This governance model necessarily leaves many situations unspecified. If questions arise as to how a given situation should proceed according to the overall goals of the project, the best thing to do is to open a GitHub issue and ping the TC members.
|
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', ' screenshots-cleanup - https://github.com/andriilazebnyi/wdio-screenshots-cleanup-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'];
|
|
@@ -453,9 +453,8 @@ var launch = function launch() {
|
|
|
453
453
|
* if stdin.isTTY, then no piped input is present and launcher should be
|
|
454
454
|
* called immediately, otherwise piped input is processed, expecting
|
|
455
455
|
* a list of files to process.
|
|
456
|
-
* stdin.isTTY is false when command is from nodes spawn since it's treated as a pipe
|
|
457
456
|
*/
|
|
458
|
-
if (process.stdin.isTTY
|
|
457
|
+
if (process.stdin.isTTY) {
|
|
459
458
|
launch();
|
|
460
459
|
} else {
|
|
461
460
|
var stdinData = '';
|
|
@@ -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>
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
var _ErrorHandler = require('../utils/ErrorHandler');
|
|
8
8
|
|
|
9
9
|
var DEFAULT_SELECTOR = 'css selector';
|
|
10
|
-
var DIRECT_SELECTOR_REGEXP = /^(id|css selector|xpath|link text|partial link text|name|tag name|class name|-android uiautomator|-ios uiautomation|accessibility id):(.+)/;
|
|
10
|
+
var DIRECT_SELECTOR_REGEXP = /^(id|css selector|xpath|link text|partial link text|name|tag name|class name|-android uiautomator|-ios uiautomation|-ios predicate string|-ios class chain|accessibility id):(.+)/;
|
|
11
11
|
|
|
12
12
|
var findStrategy = function findStrategy() {
|
|
13
13
|
var value = arguments.length <= 0 ? undefined : arguments[0];
|
|
@@ -67,11 +67,23 @@ var findStrategy = function findStrategy() {
|
|
|
67
67
|
using = '-android uiautomator';
|
|
68
68
|
value = value.slice(8);
|
|
69
69
|
|
|
70
|
-
// recursive element search using the UIAutomation library (iOS-only)
|
|
70
|
+
// recursive element search using the UIAutomation or XCUITest library (iOS-only)
|
|
71
71
|
} else if (value.indexOf('ios=') === 0) {
|
|
72
|
-
using = '-ios uiautomation';
|
|
73
72
|
value = value.slice(4);
|
|
74
73
|
|
|
74
|
+
if (value.indexOf('predicate=') === 0) {
|
|
75
|
+
// Using 'ios=predicate=' (iOS 10+ only)
|
|
76
|
+
using = '-ios predicate string';
|
|
77
|
+
value = value.slice(10);
|
|
78
|
+
} else if (value.indexOf('chain=') === 0) {
|
|
79
|
+
// Using 'ios=chain=' (iOS 10+ only)
|
|
80
|
+
using = '-ios class chain';
|
|
81
|
+
value = value.slice(6);
|
|
82
|
+
} else {
|
|
83
|
+
// Legacy iOS (<= 9.3) UIAutomation library
|
|
84
|
+
using = '-ios uiautomation';
|
|
85
|
+
}
|
|
86
|
+
|
|
75
87
|
// recursive element search using accessibility id
|
|
76
88
|
} else if (value.indexOf('~') === 0) {
|
|
77
89
|
using = 'accessibility id';
|
|
@@ -16,16 +16,13 @@ var _jsonStringifySafe = require('json-stringify-safe');
|
|
|
16
16
|
|
|
17
17
|
var _jsonStringifySafe2 = _interopRequireDefault(_jsonStringifySafe);
|
|
18
18
|
|
|
19
|
-
var _validator = require('validator');
|
|
20
|
-
|
|
21
|
-
var _validator2 = _interopRequireDefault(_validator);
|
|
22
|
-
|
|
23
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
20
|
|
|
25
21
|
var OBJLENGTH = 10;
|
|
26
22
|
var ARRLENGTH = 10;
|
|
27
23
|
var STRINGLIMIT = 1000;
|
|
28
24
|
var STRINGTRUNCATE = 200;
|
|
25
|
+
var notBase64 = /[^A-Z0-9+/=]/i;
|
|
29
26
|
|
|
30
27
|
var sanitizeString = function sanitizeString(str) {
|
|
31
28
|
if (!str) {
|
|
@@ -91,6 +88,20 @@ var css = function css(value) {
|
|
|
91
88
|
return value.trim().replace(/'/g, '').replace(/"/g, '').toLowerCase();
|
|
92
89
|
};
|
|
93
90
|
|
|
91
|
+
var isBase64 = function isBase64(str) {
|
|
92
|
+
if (typeof str !== 'string') {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var len = str.length;
|
|
97
|
+
if (!len || len % 4 !== 0 || notBase64.test(str)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
var firstPaddingChar = str.indexOf('=');
|
|
102
|
+
return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === '=';
|
|
103
|
+
};
|
|
104
|
+
|
|
94
105
|
/**
|
|
95
106
|
* Limit the length of an arbitrary variable of any type, suitable for being logged or displayed
|
|
96
107
|
* @param {Any} val Any variable
|
|
@@ -104,7 +115,7 @@ var limit = function limit(val) {
|
|
|
104
115
|
|
|
105
116
|
switch (Object.prototype.toString.call(val)) {
|
|
106
117
|
case '[object String]':
|
|
107
|
-
if (val.length > 100 &&
|
|
118
|
+
if (val.length > 100 && isBase64(val)) {
|
|
108
119
|
return `[base64] ${val.length} bytes`;
|
|
109
120
|
}
|
|
110
121
|
|
|
@@ -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/lib/launcher.js
CHANGED
|
@@ -521,7 +521,7 @@ var Launcher = function () {
|
|
|
521
521
|
return a.runningInstances;
|
|
522
522
|
}).reduce(function (a, b) {
|
|
523
523
|
return a + b;
|
|
524
|
-
});
|
|
524
|
+
}, 0);
|
|
525
525
|
}
|
|
526
526
|
|
|
527
527
|
/**
|
|
@@ -536,7 +536,7 @@ var Launcher = function () {
|
|
|
536
536
|
return a.specs.length;
|
|
537
537
|
}).reduce(function (a, b) {
|
|
538
538
|
return a + b;
|
|
539
|
-
});
|
|
539
|
+
}, 0);
|
|
540
540
|
}
|
|
541
541
|
|
|
542
542
|
/**
|
|
@@ -583,7 +583,7 @@ var Launcher = function () {
|
|
|
583
583
|
|
|
584
584
|
// The default value for child.fork execArgs is process.execArgs,
|
|
585
585
|
// so continue to use this unless another value is specified in config.
|
|
586
|
-
var defaultArgs = capExecArgs.length ? process.execArgv : [];
|
|
586
|
+
var defaultArgs = capExecArgs.length === 0 ? process.execArgv : [];
|
|
587
587
|
|
|
588
588
|
// If an arg appears multiple times the last occurrence is used
|
|
589
589
|
var execArgv = [].concat((0, _toConsumableArray3.default)(defaultArgs), debugArgs, (0, _toConsumableArray3.default)(capExecArgs));
|
|
@@ -593,6 +593,45 @@ var Launcher = function () {
|
|
|
593
593
|
execArgv
|
|
594
594
|
});
|
|
595
595
|
|
|
596
|
+
/**
|
|
597
|
+
* increase framework timeout to 10m when debugging is enabled
|
|
598
|
+
*/
|
|
599
|
+
var _iteratorNormalCompletion4 = true;
|
|
600
|
+
var _didIteratorError4 = false;
|
|
601
|
+
var _iteratorError4 = undefined;
|
|
602
|
+
|
|
603
|
+
try {
|
|
604
|
+
for (var _iterator4 = (0, _getIterator3.default)(execArgv), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
|
|
605
|
+
var argv = _step4.value;
|
|
606
|
+
|
|
607
|
+
if (argv !== '--inspect') {
|
|
608
|
+
continue;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
var frameworkOptsKey = config.framework === 'mocha' ? 'mochaOpts' : config.framework === 'jasmine' ? 'jasmineNodeOpts' : 'cucumberOpts';
|
|
612
|
+
var frameworkTimeoutKey = config.framework === 'jasmine' ? 'defaultTimeoutInterval' : 'timeout';
|
|
613
|
+
|
|
614
|
+
if (!this.argv[frameworkOptsKey]) {
|
|
615
|
+
this.argv[frameworkOptsKey] = {};
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
this.argv[frameworkOptsKey][frameworkTimeoutKey] = 10 * 60 * 1000;
|
|
619
|
+
}
|
|
620
|
+
} catch (err) {
|
|
621
|
+
_didIteratorError4 = true;
|
|
622
|
+
_iteratorError4 = err;
|
|
623
|
+
} finally {
|
|
624
|
+
try {
|
|
625
|
+
if (!_iteratorNormalCompletion4 && _iterator4.return) {
|
|
626
|
+
_iterator4.return();
|
|
627
|
+
}
|
|
628
|
+
} finally {
|
|
629
|
+
if (_didIteratorError4) {
|
|
630
|
+
throw _iteratorError4;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
596
635
|
this.processes.push(childProcess);
|
|
597
636
|
|
|
598
637
|
childProcess.on('message', this.messageHandler.bind(this, cid)).on('exit', this.endHandler.bind(this, cid));
|
|
@@ -750,13 +789,13 @@ End selenium sessions properly ...
|
|
|
750
789
|
return launchServices;
|
|
751
790
|
}
|
|
752
791
|
|
|
753
|
-
var
|
|
754
|
-
var
|
|
755
|
-
var
|
|
792
|
+
var _iteratorNormalCompletion5 = true;
|
|
793
|
+
var _didIteratorError5 = false;
|
|
794
|
+
var _iteratorError5 = undefined;
|
|
756
795
|
|
|
757
796
|
try {
|
|
758
|
-
for (var
|
|
759
|
-
var serviceName =
|
|
797
|
+
for (var _iterator5 = (0, _getIterator3.default)(config.services), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
|
|
798
|
+
var serviceName = _step5.value;
|
|
760
799
|
|
|
761
800
|
var service = void 0;
|
|
762
801
|
|
|
@@ -782,16 +821,16 @@ End selenium sessions properly ...
|
|
|
782
821
|
}
|
|
783
822
|
}
|
|
784
823
|
} catch (err) {
|
|
785
|
-
|
|
786
|
-
|
|
824
|
+
_didIteratorError5 = true;
|
|
825
|
+
_iteratorError5 = err;
|
|
787
826
|
} finally {
|
|
788
827
|
try {
|
|
789
|
-
if (!
|
|
790
|
-
|
|
828
|
+
if (!_iteratorNormalCompletion5 && _iterator5.return) {
|
|
829
|
+
_iterator5.return();
|
|
791
830
|
}
|
|
792
831
|
} finally {
|
|
793
|
-
if (
|
|
794
|
-
throw
|
|
832
|
+
if (_didIteratorError5) {
|
|
833
|
+
throw _iteratorError5;
|
|
795
834
|
}
|
|
796
835
|
}
|
|
797
836
|
}
|
|
@@ -3,56 +3,29 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
var _promise = require('babel-runtime/core-js/promise');
|
|
8
|
-
|
|
9
|
-
var _promise2 = _interopRequireDefault(_promise);
|
|
10
|
-
|
|
11
6
|
exports.default = log;
|
|
12
7
|
|
|
13
8
|
var _ErrorHandler = require('../utils/ErrorHandler');
|
|
14
9
|
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
var logTypes = void 0; /**
|
|
18
|
-
*
|
|
19
|
-
* Get the log for a given log type. Log buffer is reset after each request.
|
|
20
|
-
* (Not part of the official Webdriver specification).
|
|
21
|
-
*
|
|
22
|
-
* @param {String} type The [log type](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#log-type). This must be provided.
|
|
23
|
-
* @return {Object[]} The list of [log entries](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#log-entry-json-object)
|
|
24
|
-
*
|
|
25
|
-
* @see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlog
|
|
26
|
-
* @type protocol
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
function getLogTypes() {
|
|
31
|
-
if (logTypes) {
|
|
32
|
-
return _promise2.default.resolve(logTypes);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return this.logTypes().then(function (types) {
|
|
36
|
-
logTypes = types;
|
|
37
|
-
return logTypes;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
10
|
function log(type) {
|
|
42
|
-
var _this = this;
|
|
43
|
-
|
|
44
11
|
if (typeof type !== 'string' || type === '') {
|
|
45
12
|
throw new _ErrorHandler.ProtocolError('number or type of arguments don\'t agree with log command');
|
|
46
13
|
}
|
|
47
14
|
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
throw new _ErrorHandler.ProtocolError(`this log type ("${type}") is not available for this browser/device`);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return _this.requestHandler.create('/session/:sessionId/log', {
|
|
54
|
-
type: type
|
|
55
|
-
});
|
|
15
|
+
return this.requestHandler.create('/session/:sessionId/log', {
|
|
16
|
+
type: type
|
|
56
17
|
});
|
|
57
|
-
}
|
|
18
|
+
} /**
|
|
19
|
+
*
|
|
20
|
+
* Get the log for a given log type. Log buffer is reset after each request.
|
|
21
|
+
* (Not part of the official Webdriver specification).
|
|
22
|
+
*
|
|
23
|
+
* @param {String} type The [log type](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#log-type). This must be provided.
|
|
24
|
+
* @return {Object[]} The list of [log entries](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#log-entry-json-object)
|
|
25
|
+
*
|
|
26
|
+
* @see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlog
|
|
27
|
+
* @type protocol
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
|
|
58
31
|
module.exports = exports['default'];
|
|
@@ -200,7 +200,7 @@ var executeClientSide = function executeClientSide(fn, sArr, args) {
|
|
|
200
200
|
if (typeof cb === 'function') {
|
|
201
201
|
return cb('NoSuchElement') && new Error('NoSuchElement');
|
|
202
202
|
}
|
|
203
|
-
|
|
203
|
+
throw new Error('NoSuchElement');
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
parameter.push(arguments[arguments.length - 1]);
|
|
@@ -112,6 +112,7 @@ var DEFAULT_CONFIGS = {
|
|
|
112
112
|
afterScenario: [],
|
|
113
113
|
afterStep: []
|
|
114
114
|
};
|
|
115
|
+
var FILE_EXTENSIONS = ['.js', '.ts', '.feature', '.coffee', '.es6'];
|
|
115
116
|
|
|
116
117
|
var ConfigParser = function () {
|
|
117
118
|
function ConfigParser() {
|
|
@@ -475,7 +476,7 @@ var ConfigParser = function () {
|
|
|
475
476
|
var filenames = _glob2.default.sync(pattern);
|
|
476
477
|
|
|
477
478
|
filenames = filenames.filter(function (filename) {
|
|
478
|
-
return
|
|
479
|
+
return FILE_EXTENSIONS.indexOf(_path2.default.extname(filename)) !== -1;
|
|
479
480
|
});
|
|
480
481
|
|
|
481
482
|
filenames = filenames.map(function (filename) {
|
|
@@ -144,7 +144,9 @@ var RequestHandler = function () {
|
|
|
144
144
|
newOptions.json = true;
|
|
145
145
|
newOptions.followAllRedirects = true;
|
|
146
146
|
|
|
147
|
-
if (this.defaultOptions.
|
|
147
|
+
if (this.defaultOptions.agent) {
|
|
148
|
+
newOptions.agent = this.defaultOptions.agent;
|
|
149
|
+
} else if (this.defaultOptions.protocol === 'http') {
|
|
148
150
|
newOptions.agent = httpAgent;
|
|
149
151
|
} else if (this.defaultOptions.protocol === 'https') {
|
|
150
152
|
newOptions.agent = httpsAgent;
|
|
@@ -178,6 +180,7 @@ var RequestHandler = function () {
|
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
newOptions.timeout = this.defaultOptions.connectionRetryTimeout;
|
|
183
|
+
newOptions.proxy = this.defaultOptions.proxy;
|
|
181
184
|
|
|
182
185
|
return newOptions;
|
|
183
186
|
}
|
package/build/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webdriverio",
|
|
3
3
|
"description": "A Node.js bindings implementation for the W3C WebDriver protocol",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.12.0",
|
|
5
5
|
"homepage": "http://webdriver.io",
|
|
6
6
|
"author": "Camilo Tapia <camilo.tapia@gmail.com>",
|
|
7
7
|
"repository": {
|
|
@@ -78,7 +78,6 @@
|
|
|
78
78
|
"safe-buffer": "~5.1.1",
|
|
79
79
|
"supports-color": "~5.0.0",
|
|
80
80
|
"url": "~0.11.0",
|
|
81
|
-
"validator": "~9.1.1",
|
|
82
81
|
"wdio-dot-reporter": "~0.0.8",
|
|
83
82
|
"wgxpath": "~1.0.0"
|
|
84
83
|
},
|
|
@@ -91,6 +91,18 @@ Path to WebDriver server.
|
|
|
91
91
|
Type: `String`<br>
|
|
92
92
|
Default: */wd/hub*
|
|
93
93
|
|
|
94
|
+
### agent
|
|
95
|
+
http(s).Agent instance to use
|
|
96
|
+
|
|
97
|
+
Type: `Object`<br>
|
|
98
|
+
Default: `new http(s).Agent({ keepAlive: true })`
|
|
99
|
+
|
|
100
|
+
### proxy
|
|
101
|
+
An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the url parameter (by embedding the auth info in the uri)
|
|
102
|
+
|
|
103
|
+
Type: `String`<br>
|
|
104
|
+
Default: `undefined` (no proxy used)
|
|
105
|
+
|
|
94
106
|
### baseUrl
|
|
95
107
|
Shorten `url` command calls by setting a base url. If your `url` parameter starts with `/`, the base url gets prepended, not including the path portion of your baseUrl. If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url gets prepended directly.
|
|
96
108
|
|
|
@@ -122,7 +134,7 @@ Type: `Boolean`<br>
|
|
|
122
134
|
Default: *true*
|
|
123
135
|
|
|
124
136
|
### 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).
|
|
137
|
+
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
138
|
|
|
127
139
|
Type: `Number`<br>
|
|
128
140
|
Default: *0* (don't bail, run all tests)
|
|
@@ -293,3 +305,23 @@ Similarly for mocha:
|
|
|
293
305
|
requires: ['./test/helpers/common.js']
|
|
294
306
|
},
|
|
295
307
|
```
|
|
308
|
+
|
|
309
|
+
## Run WebdriverIO behind corperate proxy
|
|
310
|
+
|
|
311
|
+
If your company has a corperate proxy (e.g. on `http://my.corp.proxy.com:9090`) for all outgoing requests you can set it using the `proxy` configuration option. Just set in your `wdio.conf.js` the following:
|
|
312
|
+
|
|
313
|
+
```js
|
|
314
|
+
exports.config = {
|
|
315
|
+
// ...
|
|
316
|
+
proxy: 'http://my.corp.proxy.com:9090',
|
|
317
|
+
// ...
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
If you use [Sauce Connect Proxy](https://wiki.saucelabs.com/display/DOCS/Sauce+Connect+Proxy) start it via:
|
|
322
|
+
|
|
323
|
+
```sh
|
|
324
|
+
$ sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY --no-autodetect -p http://my.corp.proxy.com:9090
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
and set the config as described above.
|
|
@@ -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
|