Skip to content

Instantly share code, notes, and snippets.

@codiophile
Created November 6, 2017 00:04
Show Gist options
  • Save codiophile/0ba8e8c6e9eaa158c866f53c3ee41ac0 to your computer and use it in GitHub Desktop.
Save codiophile/0ba8e8c6e9eaa158c866f53c3ee41ac0 to your computer and use it in GitHub Desktop.
Diff between locally built webdriverio and webdriverio downloaded from npm
diff -ur node_modules/webdriverio/build/index.js node_modules.broken/webdriverio/build/index.js
--- node_modules/webdriverio/build/index.js 2017-04-11 03:53:12.000000000 +0100
+++ node_modules.broken/webdriverio/build/index.js 2017-11-05 15:44:57.000000000 +0000
@@ -41,7 +41,7 @@
/**
* webdriverio
- * https://github.com/Camme/webdriverio
+ * https://github.com/webdriverio/webdriverio
*
* A WebDriver module for nodejs. Either use the super easy help commands or use the base
* Webdriver wire protocol commands. Its totally inspired by jellyfishs webdriver, but the
diff -ur node_modules/webdriverio/build/lib/commands/touchAction.js node_modules.broken/webdriverio/build/lib/commands/touchAction.js
--- node_modules/webdriverio/build/lib/commands/touchAction.js 2017-04-30 17:27:17.000000000 +0100
+++ node_modules.broken/webdriverio/build/lib/commands/touchAction.js 2017-11-05 15:44:58.000000000 +0000
@@ -146,12 +146,12 @@
return formatArgs(selector, action);
}
- var formattedAction = { action: action.action, options: {} };
+ var formattedAction = { action: action.action, options: {}
- /**
- * propagate selector or element to options object
- */
- if (selector &&
+ /**
+ * propagate selector or element to options object
+ */
+ };if (selector &&
// selector is given as string `e.g. browser.touchAction(selector, 'tap')`
typeof selector === 'string' &&
// don't propagate for actions that don't require element options
diff -ur node_modules/webdriverio/build/lib/helpers/constants.js node_modules.broken/webdriverio/build/lib/helpers/constants.js
--- node_modules/webdriverio/build/lib/helpers/constants.js 2017-04-30 17:27:17.000000000 +0100
+++ node_modules.broken/webdriverio/build/lib/helpers/constants.js 2017-11-05 15:44:59.000000000 +0000
@@ -25,12 +25,11 @@
ltgray: '\x1b[0;37m',
white: '\x1b[1;37m',
reset: '\x1b[0m'
-};
-/**
- * Webdriver Errors
- */
-var Unknown = { id: 'Unknown', status: -1, message: 'Remote end send an unknown status code.' };
+ /**
+ * Webdriver Errors
+ */
+};var Unknown = { id: 'Unknown', status: -1, message: 'Remote end send an unknown status code.' };
var Success = { id: 'Success', status: 0, message: 'The command executed successfully.' };
var NoSuchDriver = { id: 'NoSuchDriver', status: 6, message: 'A session is either terminated or not started' };
var NoSuchElement = { id: 'NoSuchElement', status: 404, message: 'An element could not be located on the page using the given search parameters.' };
@@ -70,13 +69,13 @@
var NoSuchCookie = { id: 'NoSuchCookie', status: 404, message: 'No cookie matching the given path name was found amongst the associated cookies of the current browsing context’s active document.' };
var UnableToCaptureScreen = { id: 'UnableToCaptureScreen', status: 500, message: 'A screen capture was made impossible.' };
var UnknownMethod = { id: 'UnknownMethod', status: 405, message: 'The requested command matched a known URL but did not match an method for that URL.' };
-var UnsupportedOperation = { id: 'UnsupportedOperation', status: 500, message: 'Indicates that a command that should have executed properly cannot be supported for some reason.' };
+var UnsupportedOperation = { id: 'UnsupportedOperation', status: 500, message: 'Indicates that a command that should have executed properly cannot be supported for some reason.'
-/**
- * selenium error codes
- * https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error-code
- */
-var ERROR_CODES = {
+ /**
+ * selenium error codes
+ * https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error-code
+ */
+};var ERROR_CODES = {
'-1': Unknown,
'0': Success,
'6': NoSuchDriver,
@@ -138,13 +137,12 @@
'unknown error': UnknownError,
'unknown method': UnknownMethod,
'unsupported operation': UnsupportedOperation
-};
-/**
- * unicode characters
- * https://w3c.github.io/webdriver/webdriver-spec.html#character-types
- */
-var UNICODE_CHARACTERS = {
+ /**
+ * unicode characters
+ * https://w3c.github.io/webdriver/webdriver-spec.html#character-types
+ */
+};var UNICODE_CHARACTERS = {
'NULL': '\uE000',
'Unidentified': '\uE000',
'Cancel': '\uE001',
diff -ur node_modules/webdriverio/build/lib/helpers/handleMouseButtonProtocol.js node_modules.broken/webdriverio/build/lib/helpers/handleMouseButtonProtocol.js
--- node_modules/webdriverio/build/lib/helpers/handleMouseButtonProtocol.js 2017-04-30 17:27:18.000000000 +0100
+++ node_modules.broken/webdriverio/build/lib/helpers/handleMouseButtonProtocol.js 2017-11-05 15:44:59.000000000 +0000
@@ -7,12 +7,11 @@
left: 0,
middle: 1,
right: 2
-};
-/**
- * call must be scoped to the webdriverio client
- */
-var handleMouseButtonProtocol = function handleMouseButtonProtocol(requestPath, button) {
+ /**
+ * call must be scoped to the webdriverio client
+ */
+};var handleMouseButtonProtocol = function handleMouseButtonProtocol(requestPath, button) {
if (typeof button !== 'number') {
button = BUTTON_ENUM[button || 'left'];
}
diff -ur node_modules/webdriverio/build/lib/helpers/wdio.conf.ejs node_modules.broken/webdriverio/build/lib/helpers/wdio.conf.ejs
--- node_modules/webdriverio/build/lib/helpers/wdio.conf.ejs 2017-04-11 03:53:24.000000000 +0100
+++ node_modules.broken/webdriverio/build/lib/helpers/wdio.conf.ejs 2017-11-05 15:45:03.000000000 +0000
@@ -241,7 +241,14 @@
*/
// before: function (capabilities, specs) {
// },
- //
+ /**
+ * Runs before a WebdriverIO command gets executed.
+ * @param {String} commandName hook command name
+ * @param {Array} args arguments that command would receive
+ */
+ // beforeCommand: function (commandName, args) {
+ // },
+ <% if(answers.framework === 'mocha' || answers.framework === 'jasmine') { %>
/**
* Hook that gets executed before the suite starts
* @param {Object} suite suite details
@@ -249,6 +256,12 @@
// beforeSuite: function (suite) {
// },
/**
+ * Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
+ * @param {Object} test test details
+ */
+ // beforeTest: function (test) {
+ // },
+ /**
* Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
* beforeEach in Mocha)
*/
@@ -261,38 +274,64 @@
// afterHook: function () {
// },
/**
- * Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
+ * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
* @param {Object} test test details
*/
- // beforeTest: function (test) {
+ // afterTest: function (test) {
// },
/**
- * Runs before a WebdriverIO command gets executed.
- * @param {String} commandName hook command name
- * @param {Array} args arguments that command would receive
+ * Hook that gets executed after the suite has ended
+ * @param {Object} suite suite details
*/
- // beforeCommand: function (commandName, args) {
+ // afterSuite: function (suite) {
// },
+ <% }
+ if(answers.framework === 'cucumber') { %>
/**
- * Runs after a WebdriverIO command gets executed
- * @param {String} commandName hook command name
- * @param {Array} args arguments that command would receive
- * @param {Number} result 0 - command success, 1 - command error
- * @param {Object} error error object if any
+ * Runs before a Cucumber feature
+ * @param {Object} feature feature details
*/
- // afterCommand: function (commandName, args, result, error) {
+ // beforeFeature: function (feature) {
// },
/**
- * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
- * @param {Object} test test details
+ * Runs before a Cucumber scenario
+ * @param {Object} scenario scenario details
*/
- // afterTest: function (test) {
+ // beforeScenario: function (scenario) {
// },
/**
- * Hook that gets executed after the suite has ended
- * @param {Object} suite suite details
+ * Runs before a Cucumber step
+ * @param {Object} step step details
*/
- // afterSuite: function (suite) {
+ // beforeStep: function (step) {
+ // },
+ /**
+ * Runs after a Cucumber step
+ * @param {Object} stepResult step result
+ */
+ // afterStep: function (stepResult) {
+ // },
+ /**
+ * Runs after a Cucumber scenario
+ * @param {Object} scenario scenario details
+ */
+ // afterScenario: function (scenario) {
+ // },
+ /**
+ * Runs after a Cucumber feature
+ * @param {Object} feature feature details
+ */
+ // afterFeature: function (feature) {
+ // },
+ <% } %>
+ /**
+ * Runs after a WebdriverIO command gets executed
+ * @param {String} commandName hook command name
+ * @param {Array} args arguments that command would receive
+ * @param {Number} result 0 - command success, 1 - command error
+ * @param {Object} error error object if any
+ */
+ // afterCommand: function (commandName, args, result, error) {
// },
/**
* Gets executed after all tests are done. You still have access to all global variables from
@@ -312,10 +351,11 @@
// afterSession: function (config, capabilities, specs) {
// },
/**
- * Gets executed after all workers got shut down and the process is about to exit. It is not
- * possible to defer the end of the process using a promise.
+ * Gets executed after all workers got shut down and the process is about to exit.
* @param {Object} exitCode 0 - success, 1 - fail
+ * @param {Object} config wdio configuration object
+ * @param {Array.<Object>} capabilities list of capabilities details
*/
- // onComplete: function(exitCode) {
+ // onComplete: function(exitCode, config, capabilities) {
// }
}
diff -ur node_modules/webdriverio/build/lib/launcher.js node_modules.broken/webdriverio/build/lib/launcher.js
--- node_modules/webdriverio/build/lib/launcher.js 2017-04-30 17:27:19.000000000 +0100
+++ node_modules.broken/webdriverio/build/lib/launcher.js 2017-11-05 15:44:59.000000000 +0000
@@ -215,7 +215,7 @@
}, {
key: 'run',
value: function () {
- var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() {
+ var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
var _this = this;
var config, caps, launcher, _exitCode, cid, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, capabilities, exitCode;
@@ -385,7 +385,7 @@
}, {
key: 'runServiceHook',
value: function () {
- var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(launcher, hookName) {
+ var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(launcher, hookName) {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
diff -ur node_modules/webdriverio/build/lib/protocol/cookie.js node_modules.broken/webdriverio/build/lib/protocol/cookie.js
--- node_modules/webdriverio/build/lib/protocol/cookie.js 2017-04-30 17:27:20.000000000 +0100
+++ node_modules.broken/webdriverio/build/lib/protocol/cookie.js 2017-11-05 15:44:59.000000000 +0000
@@ -43,12 +43,11 @@
var requestOptions = {
path: '/session/:sessionId/cookie',
method: method
- };
- /**
- * set cookie param for POST method
- */
- if (method.toUpperCase() === 'POST' && typeof args === 'object') {
+ /**
+ * set cookie param for POST method
+ */
+ };if (method.toUpperCase() === 'POST' && typeof args === 'object') {
data.cookie = args;
}
diff -ur node_modules/webdriverio/build/lib/protocol/touchScroll.js node_modules.broken/webdriverio/build/lib/protocol/touchScroll.js
--- node_modules/webdriverio/build/lib/protocol/touchScroll.js 2017-04-30 17:27:22.000000000 +0100
+++ node_modules.broken/webdriverio/build/lib/protocol/touchScroll.js 2017-11-05 15:45:00.000000000 +0000
@@ -14,17 +14,19 @@
* start scrolling at a particular screen location
*/
if (arguments.length === 3 && id && typeof xoffset === 'number' && typeof yoffset === 'number') {
- data = { element: id, xoffset: xoffset, yoffset: yoffset };
+ data = { element: id, xoffset: xoffset, yoffset: yoffset
- /*!
- * if you don't care where the scroll starts on the screen
- */
+ /*!
+ * if you don't care where the scroll starts on the screen
+ */
+ };
} else if (arguments.length === 3 && !id && typeof xoffset === 'number' && typeof yoffset === 'number') {
- data = { xoffset: xoffset, yoffset: yoffset };
+ data = { xoffset: xoffset, yoffset: yoffset
- /*!
- * if you don't care where the scroll starts on the screen
- */
+ /*!
+ * if you don't care where the scroll starts on the screen
+ */
+ };
} else if (arguments.length === 2 && typeof id === 'number' && typeof xoffset === 'number') {
data = {
xoffset: id,
diff -ur node_modules/webdriverio/build/lib/protocol/windowHandleSize.js node_modules.broken/webdriverio/build/lib/protocol/windowHandleSize.js
--- node_modules/webdriverio/build/lib/protocol/windowHandleSize.js 2017-04-30 17:27:22.000000000 +0100
+++ node_modules.broken/webdriverio/build/lib/protocol/windowHandleSize.js 2017-11-05 15:45:01.000000000 +0000
@@ -26,12 +26,11 @@
var requestOptions = {
path: '/session/:sessionId/window/' + windowHandle + '/size',
method: 'GET'
- };
- /*!
- * change window size if the new size is given
- */
- if (typeof size === 'object' && size.width && size.height) {
+ /*!
+ * change window size if the new size is given
+ */
+ };if (typeof size === 'object' && size.width && size.height) {
requestOptions.method = 'POST';
// The width and height value might return as a negative value, so
// we make sure to use its absolute value.
diff -ur node_modules/webdriverio/build/lib/runner.js node_modules.broken/webdriverio/build/lib/runner.js
--- node_modules/webdriverio/build/lib/runner.js 2017-04-30 17:27:23.000000000 +0100
+++ node_modules.broken/webdriverio/build/lib/runner.js 2017-11-05 15:45:01.000000000 +0000
@@ -62,7 +62,7 @@
(0, _createClass3.default)(Runner, [{
key: 'run',
value: function () {
- var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(m) {
+ var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(m) {
var _this = this;
var config, res;
@@ -320,7 +320,7 @@
}, {
key: 'end',
value: function () {
- var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2() {
+ var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {
var failures = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var inWatchMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.inWatchMode;
var sendProcessEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
@@ -382,7 +382,7 @@
console.log(WATCH_NOTIFICATION);
this.gaze.on('changed', function () {
- var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(filepath) {
+ var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(filepath) {
var failures;
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
diff -ur node_modules/webdriverio/build/package.json node_modules.broken/webdriverio/build/package.json
--- node_modules/webdriverio/build/package.json 2017-04-11 03:53:24.000000000 +0100
+++ node_modules.broken/webdriverio/build/package.json 2017-11-05 15:45:03.000000000 +0000
@@ -1,7 +1,7 @@
{
"name": "webdriverio",
- "description": "A nodejs bindings implementation for selenium 2.0/webdriver",
- "version": "4.6.2",
+ "description": "A Node.js bindings implementation for the W3C WebDriver protocol",
+ "version": "4.8.0",
"homepage": "http://webdriver.io",
"author": "Camilo Tapia <[email protected]>",
"repository": {
@@ -24,12 +24,16 @@
"clean": "run-p clean:*",
"clean:build": "rm -fr build",
"clean:coverage": "rm -fr coverage",
- "clean:cordova": "rm -fr test/site/platforms",
+ "clean:cordova": "rm -fr test/site/platforms test/site/plugins",
"clean:ios": "rm -fr test/site/platforms/ios",
"clean:android": "rm -fr test/site/platforms/android",
"compile": "run-p compile:*",
"compile:index": "mkdir -p build && babel index.js --out-file build/index.js",
"compile:lib": "babel lib/ -d build/lib",
+ "cordova": "npm-run-all cordova:add_platforms --parallel cordova:compile:*",
+ "cordova:add_platforms": "cd ./test/site && cordova platform add ios android && cd ../../",
+ "cordova:compile:android": "cd ./test/site && cordova build android && cd ../../",
+ "cordova:compile:ios": "cd ./test/site && cordova build ios && cd ../../",
"copy": "run-p copy:*",
"copy:packagejson": "cp package.json build",
"copy:ejstemplate": "cp lib/helpers/wdio.conf.ejs build/lib/helpers/wdio.conf.ejs",
@@ -39,15 +43,23 @@
"release:minor": "np minor",
"release:major": "np major",
"test": "run-s eslint test:unit",
- "test:ci": "run-s clean eslint test:cover",
- "test:unit": "mocha --compilers js:babel-core/register test/*.js",
+ "test:android": "mocha test/setup.js test/spec/mobile/*.js test/spec/mobile/android/*.js",
+ "test:ci": "run-s eslint build test:$_ENV",
"test:cover": "babel-node ./node_modules/.bin/isparta cover --include 'lib/*.js' _mocha",
+ "test:desktop": "mocha test/setup.js test/spec/*.js test/spec/desktop/*.js",
+ "test:functional": "mocha test/setup.js test/spec/functional/**/*.js",
+ "test:ios": "mocha test/setup.js test/spec/mobile/*.js test/spec/mobile/ios/*.js",
+ "test:mobile": "run-s test:ios test:android",
+ "test:multibrowser": "mocha test/setup.js test/spec/multibrowser/**/*.js",
"test:snyk": "snyk auth $SNYK_AUTH_TOKEN && snyk test",
+ "test:unit": "mocha test/setup-unit.js test/spec/unit/*.js",
+ "test:wdio": "mocha test/setup-unit.js test/spec/wdio/*.js",
"prepublish": "npm prune",
"watch": "npm run compile:lib -- --watch"
},
"dependencies": {
"archiver": "~1.3.0",
+ "babel-runtime": "~6.23.0",
"css-parse": "~2.0.0",
"css-value": "~0.0.1",
"deepmerge": "~1.3.2",
@@ -74,10 +86,8 @@
"babel-core": "^6.24.1",
"babel-eslint": "^7.2.1",
"babel-plugin-add-module-exports": "^0.2.1",
- "babel-plugin-syntax-async-functions": "^6.13.0",
- "babel-plugin-transform-regenerator": "^6.24.1",
"babel-plugin-transform-runtime": "^6.23.0",
- "babel-preset-es2015": "^6.24.1",
+ "babel-preset-env": "^1.3.3",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.24.1",
"chai": "^3.5.0",
@@ -85,9 +95,10 @@
"chai-string": "^1.3.0",
"chai-things": "^0.2.0",
"codeclimate-test-reporter": "^0.4.1",
+ "cordova": "^6.5.0",
"coveralls": "^2.13.0",
"eslint": "^3.19.0",
- "eslint-config-standard": "^10.2.0",
+ "eslint-config-standard": "^10.2.1",
"eslint-plugin-chai-expect": "^1.1.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-mocha": "^4.9.0",
@@ -99,7 +110,10 @@
"mocha": "^3.2.0",
"mock-require": "^2.0.2",
"nock": "^9.0.13",
- "npm-run-all": "4.0.2",
+ "node-static": "^0.7.9",
+ "np": "2.13.2",
+ "npm-run-all": "^4.0.2",
+ "sauce-connect-launcher": "^1.2.1",
"saucelabs": "^1.4.0",
"sinon": "^2.1.0",
"snyk": "^1.28.0",
Only in node_modules.broken/webdriverio/: deploy.sh
diff -ur node_modules/webdriverio/package.json node_modules.broken/webdriverio/package.json
--- node_modules/webdriverio/package.json 2017-11-05 16:11:42.000000000 +0000
+++ node_modules.broken/webdriverio/package.json 2017-11-05 15:56:44.000000000 +0000
@@ -1,8 +1,8 @@
{
- "_from": "[email protected]",
+ "_from": "file:../webdriverio/webdriverio-4.8.0.tgz",
"_id": "[email protected]",
"_inBundle": false,
- "_integrity": "sha1-1Skpt0kID4mWf24WFAUcvIFy0TI=",
+ "_integrity": "sha1-u6U0D7ES2sFJZOZvO0tDRF10iSk=",
"_location": "/webdriverio",
"_phantomChildren": {
"ansi-escapes": "1.4.0",
@@ -20,21 +20,21 @@
"through": "2.3.8"
},
"_requested": {
- "type": "version",
- "registry": true,
- "raw": "[email protected]",
+ "type": "file",
+ "where": "/Users/user/git/project",
+ "raw": "webdriverio@file:../webdriverio/webdriverio-4.8.0.tgz",
"name": "webdriverio",
"escapedName": "webdriverio",
- "rawSpec": "4.8.0",
- "saveSpec": null,
- "fetchSpec": "4.8.0"
+ "rawSpec": "file:../webdriverio/webdriverio-4.8.0.tgz",
+ "saveSpec": "file:../webdriverio/webdriverio-4.8.0.tgz",
+ "fetchSpec": "/Users/user/git/webdriverio/webdriverio-4.8.0.tgz"
},
"_requiredBy": [
+ "#USER",
"/"
],
- "_resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-4.8.0.tgz",
- "_shasum": "d52929b749080f89967f6e1614051cbc8172d132",
- "_spec": "[email protected]",
+ "_resolved": "/Users/user/git/webdriverio/webdriverio-4.8.0.tgz",
+ "_spec": "webdriverio@file:../webdriverio/webdriverio-4.8.0.tgz",
"_where": "/Users/user/git/project",
"author": {
"name": "Camilo Tapia",
Only in node_modules/webdriverio/: phantomjsdriver.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment