Update appium-gulp-plugins
DELETE
.npmignore
-assets/
-submodules/
-test/
-coverage/
-commands-yml/
-docs/
-sample-code/
-.vscode/
-
-_vimrc_local.vim
-*.swp
-*.swo
-*~
-.*~
-.DS_Store
-.travis.yml
-*.log
-*.trace
-*.sublime-
-*.prefs
-./.npmignore
-coverage
-sample-code/

MODIFY
.travis.yml
.travis.yml
@@ -23,12 +23,6 @@ jobs:
- sudo: false
script: npm run test && npm run e2e-test
node_js: "8"
- - stage:
- os:
- - linux
- - sudo: false
- script: npm run test && npm run e2e-test
- node_js: "6"
- stage:
os:
- linux

RENAME
docs/en/commands/device/authentication/finger-print.md
docs/en/commands/device/authentication/finger_print.md
MODIFY
gulpfile.js
gulpfile.js
@@ -11,6 +11,7 @@ const boilerplate = require('appium-gulp-plugins').boilerplate.use(gulp);
const path = require('path');
const fs = require('fs');
+
// remove 'fsevents' from shrinkwrap, since it causes errors on non-Mac hosts
// see https://github.com/npm/npm/issues/2679
gulp.task('fixShrinkwrap', function (done) {
@@ -20,16 +21,13 @@ gulp.task('fixShrinkwrap', function (done) {
} catch (err) {
console.error('Could not find shrinkwrap; skipping fixing shrinkwrap. ' +
'(Original error: ' + err.message + ')');
- return;
+ return done();
}
delete shrinkwrap.dependencies.fsevents;
const shrinkwrapString = JSON.stringify(shrinkwrap, null, ' ') + '\n';
fs.writeFile('./npm-shrinkwrap.json', shrinkwrapString, done);
});
-
-
-
boilerplate({
build: 'appium',
test: {
@@ -40,7 +38,7 @@ boilerplate({
});
// generates server arguments readme
-gulp.task('docs', ['transpile'], function () {
+gulp.task('docs', gulp.series(['transpile']), function () {
const parser = require('./build/lib/parser.js');
const appiumArguments = parser.getParser().rawArgs;
const docFile = path.resolve(__dirname, "docs/en/writing-running-appium/server-args.md");
@@ -77,7 +75,7 @@ gulp.task('docs', ['transpile'], function () {
md += "|" + ((typeof argOpts.example === "undefined") ? "" : "`" + exampleArg + " " + argOpts.example + "`");
md += "|\n";
});
- // console.log(md);
+
fs.writeFile(docFile, md, function (err) {
if (err) {
console.log(err.stack);

MODIFY
lib/appium.js
lib/appium.js
@@ -202,9 +202,9 @@ class AppiumDriver extends BaseDriver {
log.warn(`Unable to get version of driver '${driver.name}'`);
}
- async getStatus () {
+ async getStatus () { // eslint-disable-line require-await
return {
- build: _.clone(await getBuildInfo()),
+ build: _.clone(getBuildInfo()),
};
}

MODIFY
lib/config.js
lib/config.js
@@ -116,7 +116,7 @@ async function getGitTimestamp (commitSha, useGitHubFallback = false) {
* and git commit hash asynchronously as soon as `updateBuildInfo` is called
* and succeeds.
*/
-async function getBuildInfo () {
+function getBuildInfo () {
return BUILD_INFO;
}
@@ -139,7 +139,7 @@ function warnNodeDeprecations () {
async function showConfig () {
await updateBuildInfo();
- console.log(JSON.stringify(await getBuildInfo())); // eslint-disable-line no-console
+ console.log(JSON.stringify(getBuildInfo())); // eslint-disable-line no-console
}
function getNonDefaultArgs (parser, args) {
@@ -228,7 +228,8 @@ async function validateTmpDir (tmpDir) {
}
}
-export { getBuildInfo, validateServerArgs, checkNodeOk, showConfig,
- warnNodeDeprecations, validateTmpDir, getNonDefaultArgs,
- getDeprecatedArgs, getGitRev, checkValidPort, APPIUM_VER,
- updateBuildInfo };
+export {
+ getBuildInfo, validateServerArgs, checkNodeOk, showConfig,
+ warnNodeDeprecations, validateTmpDir, getNonDefaultArgs, getDeprecatedArgs,
+ getGitRev, checkValidPort, APPIUM_VER, updateBuildInfo,
+};

MODIFY
lib/grid-register.js
lib/grid-register.js
@@ -21,7 +21,7 @@ async function registerNode (configFile, addr, port) {
logger.error('No data found in the node configuration file to send to the grid');
return;
}
- await postRequest(data, addr, port);
+ postRequest(data, addr, port);
}
async function registerToGrid (options_post, jsonObject) {
@@ -37,7 +37,7 @@ async function registerToGrid (options_post, jsonObject) {
}
}
-async function postRequest (data, addr, port) {
+function postRequest (data, addr, port) {
// parse json to get hub host and port
let jsonObject;
try {

MODIFY
lib/logsink.js
lib/logsink.js
@@ -52,7 +52,7 @@ function timestamp () {
function applyStripColorPatch (transport) {
let _log = transport.log.bind(transport);
transport.log = function (level, msg, meta, callback) { // eslint-disable-line promise/prefer-await-to-callbacks
- let code = /\u001b\[(\d+(;\d+)*)?m/g;
+ const code = /\u001b\[(\d+(;\d+)*)?m/g; // eslint-disable-line no-control-regex
msg = ('' + msg).replace(code, '');
_log(level, msg, meta, callback);
};

MODIFY
lib/parser.js
lib/parser.js
@@ -111,10 +111,12 @@ const args = [
}],
[['--log-level'], {
- choices: ['info', 'info:debug', 'info:info', 'info:warn', 'info:error',
+ choices: [
+ 'info', 'info:debug', 'info:info', 'info:warn', 'info:error',
'warn', 'warn:debug', 'warn:info', 'warn:warn', 'warn:error',
'error', 'error:debug', 'error:info', 'error:warn', 'error:error',
- 'debug', 'debug:debug', 'debug:info', 'debug:warn', 'debug:error'],
+ 'debug', 'debug:debug', 'debug:info', 'debug:warn', 'debug:error',
+ ],
defaultValue: 'debug',
dest: 'loglevel',
required: false,

MODIFY
lib/utils.js
lib/utils.js
@@ -253,5 +253,7 @@ function getPackageVersion (pkgName) {
const rootDir = findRoot(__dirname);
-export { inspectObject, parseCapsForInnerDriver, insertAppiumPrefixes, rootDir,
- getPackageVersion };
+export {
+ inspectObject, parseCapsForInnerDriver, insertAppiumPrefixes, rootDir,
+ getPackageVersion,
+};

MODIFY
package.json
package.json
"url": "https://github.com/appium/appium/issues"
},
"engines": {
- "node": ">=6",
- "npm": ">=3"
+ "node": ">=8",
+ "npm": ">=6"
},
"main": "./build/lib/main.js",
"bin": {
"lib": "./lib",
"doc": "./docs"
},
+ "files": [
+ "bin",
+ "lib",
+ "build/lib"
+ ],
"dependencies": {
+ "@babel/runtime": "^7.0.0",
"appium-android-driver": "^4.0.0",
"appium-base-driver": "3.x",
"appium-espresso-driver": ">=1.0.0-beta.13",
"argparse": "^1.0.10",
"async-lock": "^1.0.0",
"asyncbox": "2.x",
- "babel-runtime": "=5.8.24",
"bluebird": "3.x",
"continuation-local-storage": "3.x",
"dateformat": "^3.0.3",
"winston": "2.x"
},
"scripts": {
- "prepublish": "gulp prepublish",
+ "prepare": "gulp prepublish",
"publish": "gulp prepublish",
"test": "gulp once",
"e2e-test": "gulp e2e-test",
"precommit-test"
],
"devDependencies": {
- "appium-gulp-plugins": "^2.4.0",
+ "ajv": "^6.5.3",
+ "appium-gulp-plugins": "^3.1.0",
"babel-cli": "^6.26.0",
- "babel-eslint": "^7.x",
+ "babel-eslint": "^10.0.0",
"babel-preset-env": "^1.7.0",
"chai": "4.x",
"chai-as-promised": "7.x",
- "eslint": "^3.x",
- "eslint-config-appium": "2.x",
- "eslint-plugin-babel": "3.x",
- "eslint-plugin-import": "2.x",
- "eslint-plugin-mocha": "4.x",
- "eslint-plugin-promise": "3.x",
+ "eslint": "^5.2.0",
+ "eslint-config-appium": "3.x",
+ "eslint-plugin-import": "^2.2.0",
+ "eslint-plugin-mocha": "^5.0.0",
+ "eslint-plugin-promise": "^4.0.0",
"fancy-log": "^1.3.2",
- "gulp": "^3.9.1",
+ "gulp": "^4.0.0",
"handlebars": "^4.0.10",
"mocha": "5.x",
"pre-commit": "1.x",
},
"greenkeeper": {
"ignore": [
- "babel-eslint",
- "babel-preset-env",
- "eslint",
- "eslint-plugin-babel",
- "eslint-plugin-import",
- "eslint-plugin-mocha",
- "eslint-plugin-promise",
- "gulp",
- "babel-runtime",
"winston"
]
}

MODIFY
test/config-specs.js
test/config-specs.js
@@ -30,7 +30,7 @@ describe('Config', function () {
describe('Appium config', function () {
describe('getBuildInfo', function () {
async function verifyBuildInfoUpdate (useLocalGit) {
- const buildInfo = await getBuildInfo();
+ const buildInfo = getBuildInfo();
mockFs.expects('exists').atLeast(1).returns(useLocalGit);
buildInfo['git-sha'] = undefined;
buildInfo.built = undefined;
@@ -118,7 +118,7 @@ describe('Config', function () {
sinon.spy(console, "log");
});
it('should log the config to console', async function () {
- const config = await getBuildInfo();
+ const config = getBuildInfo();
await showConfig();
console.log.calledOnce.should.be.true; // eslint-disable-line no-console
console.log.getCall(0).args[0].should.contain(JSON.stringify(config)); // eslint-disable-line no-console
@@ -136,10 +136,10 @@ describe('Config', function () {
for (let [prop, value] of _.toPairs(process)) {
tempProcess[prop] = value;
}
- process = tempProcess;
+ process = tempProcess; // eslint-disable-line no-global-assign
});
after(function () {
- process = _process;
+ process = _process; // eslint-disable-line no-global-assign
});
describe('checkNodeOk', function () {
it('should fail if node is below 6', function () {
@@ -259,13 +259,13 @@ describe('Config', function () {
});
describe('validateTmpDir', function () {
- it('should fail to use a tmp dir with incorrect permissions', async function () {
+ it('should fail to use a tmp dir with incorrect permissions', function () {
validateTmpDir('/private/if_you_run_with_sudo_this_wont_fail').should.be.rejectedWith(/could not ensure/);
});
- it('should fail to use an undefined tmp dir', async function () {
+ it('should fail to use an undefined tmp dir', function () {
validateTmpDir().should.be.rejectedWith(/could not ensure/);
});
- it('should be able to use a tmp dir with correct permissions', async function () {
+ it('should be able to use a tmp dir with correct permissions', function () {
validateTmpDir('/tmp/test_tmp_dir/with/any/number/of/levels').should.not.be.rejected;
});
});

MODIFY
test/driver-e2e-specs.js
test/driver-e2e-specs.js
@@ -335,7 +335,7 @@ describe('Logsink', function () {
await server.close();
});
- it('should send logs to a logHandler passed in by a parent package', async function () {
+ it('should send logs to a logHandler passed in by a parent package', function () {
logs.length.should.be.above(1);
let welcomeIndex = logs[0][1].includes('versions of node') ? 1 : 0;
logs[welcomeIndex].length.should.equal(2);

MODIFY
test/driver-specs.js
test/driver-specs.js
@@ -24,7 +24,7 @@ describe('AppiumDriver', function () {
let fakeDriver = new FakeDriver();
let mockFakeDriver = sinon.mock(fakeDriver);
appium.getDriverForCaps = function (/*args*/) {
- return () => {
+ return function Driver () {
return fakeDriver;
};
};
@@ -41,16 +41,16 @@ describe('AppiumDriver', function () {
await appium.deleteSession(SESSION_ID);
});
- it('should call inner driver\'s createSession with desired capabilities', async function () {
+ it(`should call inner driver's createSession with desired capabilities`, async function () {
mockFakeDriver.expects("createSession")
.once().withExactArgs(BASE_CAPS, undefined, null, [])
.returns([SESSION_ID, BASE_CAPS]);
await appium.createSession(BASE_CAPS);
mockFakeDriver.verify();
});
- it('should call inner driver\'s createSession with desired and default capabilities', async function () {
- let defaultCaps = {deviceName: 'Emulator'}
- , allCaps = _.extend(_.clone(defaultCaps), BASE_CAPS);
+ it(`should call inner driver's createSession with desired and default capabilities`, async function () {
+ let defaultCaps = {deviceName: 'Emulator'};
+ let allCaps = _.extend(_.clone(defaultCaps), BASE_CAPS);
appium.args.defaultCapabilities = defaultCaps;
mockFakeDriver.expects("createSession")
.once().withArgs(allCaps)
@@ -58,7 +58,7 @@ describe('AppiumDriver', function () {
await appium.createSession(BASE_CAPS);
mockFakeDriver.verify();
});
- it('should call inner driver\'s createSession with desired and default capabilities without overriding caps', async function () {
+ it(`should call inner driver's createSession with desired and default capabilities without overriding caps`, async function () {
// a default capability with the same key as a desired capability
// should do nothing
let defaultCaps = {platformName: 'Ersatz'};
@@ -73,9 +73,11 @@ describe('AppiumDriver', function () {
appium.args.sessionOverride = true;
// mock three sessions that should be removed when the new one is created
- let fakeDrivers = [new FakeDriver(),
+ let fakeDrivers = [
new FakeDriver(),
- new FakeDriver()];
+ new FakeDriver(),
+ new FakeDriver(),
+ ];
let mockFakeDrivers = _.map(fakeDrivers, (fd) => {return sinon.mock(fd);});
mockFakeDrivers[0].expects('deleteSession')
.once();
@@ -236,8 +238,8 @@ describe('AppiumDriver', function () {
describe('sessionExists', function () {
});
describe('attachUnexpectedShutdownHandler', function () {
- let appium
- , mockFakeDriver;
+ let appium;
+ let mockFakeDriver;
beforeEach(function () {
[appium, mockFakeDriver] = getDriverAndFakeDriver();
});
@@ -273,11 +275,11 @@ describe('AppiumDriver', function () {
});
});
describe('getDriverForCaps', function () {
- it('should not blow up if user does not provide platformName', async function () {
+ it('should not blow up if user does not provide platformName', function () {
let appium = new AppiumDriver({});
(() => { appium.getDriverForCaps({}); }).should.throw(/platformName/);
});
- it('should get XCUITestDriver driver for automationName of XCUITest', async function () {
+ it('should get XCUITestDriver driver for automationName of XCUITest', function () {
let appium = new AppiumDriver({});
let driver = appium.getDriverForCaps({
platformName: 'iOS',
@@ -286,7 +288,7 @@ describe('AppiumDriver', function () {
driver.should.be.an.instanceof(Function);
driver.should.equal(XCUITestDriver);
});
- it('should get iosdriver for ios < 10', async function () {
+ it('should get iosdriver for ios < 10', function () {
let appium = new AppiumDriver({});
let caps = {
platformName: 'iOS',
@@ -316,7 +318,7 @@ describe('AppiumDriver', function () {
driver = appium.getDriverForCaps(caps);
driver.should.equal(IosDriver);
});
- it('should get xcuitestdriver for ios >= 10', async function () {
+ it('should get xcuitestdriver for ios >= 10', function () {
let appium = new AppiumDriver({});
let caps = {
platformName: 'iOS',

MODIFY
test/parser-specs.js
test/parser-specs.js
@@ -25,14 +25,12 @@ describe('Parser', function () {
});
it('should parse default capabilities correctly from a string', function () {
let defaultCapabilities = {a: 'b'};
- let args = p.parseArgs(['--default-capabilities',
- JSON.stringify(defaultCapabilities)]);
+ let args = p.parseArgs(['--default-capabilities', JSON.stringify(defaultCapabilities)]);
args.defaultCapabilities.should.eql(defaultCapabilities);
});
it('should parse default capabilities correctly from a file', function () {
let defaultCapabilities = {a: 'b'};
- let args = p.parseArgs(['--default-capabilities',
- 'test/fixtures/caps.json']);
+ let args = p.parseArgs(['--default-capabilities', 'test/fixtures/caps.json']);
args.defaultCapabilities.should.eql(defaultCapabilities);
});
it('should throw an error with invalid arg to default capabilities', function () {

MODIFY
test/shrinkwrap-specs.js
test/shrinkwrap-specs.js
@@ -9,11 +9,11 @@ chai.use(chaiAsPromised);
const expect = chai.expect;
describe.skip('shrinkwrap checks', function () {
- it('shrinkwrap file should exist', async function () {
+ it('shrinkwrap file should exist', function () {
require('../../npm-shrinkwrap.json');
});
- it('shrinkwrap should not include fsevents', async function () {
+ it('shrinkwrap should not include fsevents', function () {
// fsevents is an optional dep that only works on Mac.
// if it's in shrinkwrap, non-Mac hosts won't be able to install appium
let shrinkwrap = require('../../npm-shrinkwrap.json');

Update appium-gulp-plugins (#11461)