mirror of
https://github.com/appium/appium.git
synced 2026-04-27 05:52:35 -05:00
Require Node 4+
This commit is contained in:
@@ -49,7 +49,7 @@ Your environment needs to be setup for the particular mobile platforms that you
|
||||
want to run tests on. See below for particular platform requirements.
|
||||
|
||||
If you want to run Appium via an `npm install`, hack with or contribute to Appium, you will need
|
||||
[node.js and npm](http://nodejs.org) 0.12 or greater (use [n](https://github.com/visionmedia/n) or
|
||||
[node.js and npm](http://nodejs.org) 4 or greater (use [n](https://github.com/visionmedia/n) or
|
||||
`brew install node` to install Node.js. Make sure you have not installed Node or Appium with `sudo`,
|
||||
otherwise you'll run into problems). We recommend the latest stable version.
|
||||
|
||||
@@ -57,7 +57,7 @@ To verify that all of Appium's dependencies are met you can use
|
||||
`appium-doctor`. Install it with `npm install -g appium-doctor` (or run it
|
||||
from [source](https://github.com/appium/appium-doctor)), then run
|
||||
`appium-doctor` and supply the `--ios` or `--android` flags to verify that all
|
||||
of the dependencies are set up correctly.
|
||||
of the dependencies are set up correctly.
|
||||
|
||||
You also need to download the Appium client for your language so you can write tests. The Appium clients are simple extensions to the WebDriver clients. You can see the list of clients and links to download instructions at the [Appium clients list](/docs/en/about-appium/appium-clients.md).
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Android Setup
|
||||
|
||||
To get started, you'll need to install node.js (v0.12 or greater). Just
|
||||
To get started, you'll need to install node.js (v4 or greater). Just
|
||||
follow the [instructions for your flavor of linux](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager).
|
||||
|
||||
Once you've got node.js installed, install the [Android SDK](http://developer.android.com/sdk/index.html).
|
||||
|
||||
@@ -13,7 +13,7 @@ option to connect to an Appium server running on a Mac.
|
||||
|
||||
To get started:
|
||||
|
||||
1. Install [node.js](http://nodejs.org/download/) (v.0.12 or greater). Use the
|
||||
1. Install [node.js](http://nodejs.org/download/) (v4 or greater). Use the
|
||||
installer from nodejs.org.
|
||||
1. Install `appium-doctor` in order to check your system: `npm install appium-doctor -g`.
|
||||
Then run by typing `appium-doctor`.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## appium
|
||||
- runs basic checks
|
||||
- node version (>= 0.12)
|
||||
- node version (>= 4)
|
||||
- CLI arguments checks
|
||||
- contains all available and supported CLI arguments
|
||||
- check for deprecation and mutual exclusion
|
||||
|
||||
+5
-5
@@ -38,16 +38,16 @@ async function getAppiumConfig () {
|
||||
|
||||
function checkNodeOk () {
|
||||
let [major, minor] = getNodeVersion();
|
||||
if (major === 0 && minor < 12) {
|
||||
let msg = `Node version must be >= 0.12. Currently ${major}.${minor}`;
|
||||
if (major < 4) {
|
||||
let msg = `Node version must be >= 4. Currently ${major}.${minor}`;
|
||||
logger.errorAndThrow(msg);
|
||||
}
|
||||
}
|
||||
|
||||
function warnNodeDeprecations () {
|
||||
let [major, minor] = getNodeVersion();
|
||||
if (major === 0 && minor < 12) {
|
||||
logger.warn("Appium support for versions of node < 0.12 has been " +
|
||||
let [major] = getNodeVersion();
|
||||
if (major < 4) {
|
||||
logger.warn("Appium support for versions of node < 4 has been " +
|
||||
"deprecated and will be removed in a future version. Please " +
|
||||
"upgrade!");
|
||||
}
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@
|
||||
"url": "https://github.com/appium/appium/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.12",
|
||||
"iojs": ">=1.0.0"
|
||||
"node": ">=4",
|
||||
"npm": ">=3"
|
||||
},
|
||||
"main": "./build/lib/main.js",
|
||||
"bin": {
|
||||
|
||||
+25
-9
@@ -64,20 +64,26 @@ describe('Config', () => {
|
||||
process = _process;
|
||||
});
|
||||
describe('checkNodeOk', () => {
|
||||
it('should fail if node is below 0.12', () => {
|
||||
it('should fail if node is below 4', () => {
|
||||
process.version = 'v0.9.12';
|
||||
checkNodeOk.should.throw();
|
||||
process.version = 'v0.1';
|
||||
checkNodeOk.should.throw();
|
||||
process.version = 'v0.10.36';
|
||||
checkNodeOk.should.throw();
|
||||
process.version = 'v0.12.14';
|
||||
checkNodeOk.should.throw();
|
||||
});
|
||||
it('should succeed if node is 0.12+', () => {
|
||||
process.version = 'v0.12.0';
|
||||
it('should succeed if node is 4+', () => {
|
||||
process.version = 'v4.4.7';
|
||||
checkNodeOk.should.not.throw();
|
||||
});
|
||||
it('should succeed if node is 1.x', () => {
|
||||
process.version = 'v1.0.0';
|
||||
it('should succeed if node is 5+', () => {
|
||||
process.version = 'v5.7.0';
|
||||
checkNodeOk.should.not.throw();
|
||||
});
|
||||
it('should succeed if node is 6+', () => {
|
||||
process.version = 'v6.3.1';
|
||||
checkNodeOk.should.not.throw();
|
||||
});
|
||||
});
|
||||
@@ -90,18 +96,28 @@ describe('Config', () => {
|
||||
beforeEach(() => {
|
||||
spy.reset();
|
||||
});
|
||||
it('should log a warning if node is below 0.12', () => {
|
||||
it('should log a warning if node is below 4', () => {
|
||||
process.version = 'v0.9.12';
|
||||
warnNodeDeprecations();
|
||||
logger.warn.callCount.should.equal(1);
|
||||
});
|
||||
it('should not log a warning if node is 0.12+', () => {
|
||||
it('should log a warning if node is 0.12', () => {
|
||||
process.version = 'v0.12.0';
|
||||
warnNodeDeprecations();
|
||||
logger.warn.callCount.should.equal(1);
|
||||
});
|
||||
it('should not log a warning if node is 4+', () => {
|
||||
process.version = 'v4.4.7';
|
||||
warnNodeDeprecations();
|
||||
logger.warn.callCount.should.equal(0);
|
||||
});
|
||||
it('should not log a warning if node is 1.x', () => {
|
||||
process.version = 'v1.0.0';
|
||||
it('should not log a warning if node is 5+', () => {
|
||||
process.version = 'v5.7.0';
|
||||
warnNodeDeprecations();
|
||||
logger.warn.callCount.should.equal(0);
|
||||
});
|
||||
it('should not log a warning if node is 6+', () => {
|
||||
process.version = 'v6.3.1';
|
||||
warnNodeDeprecations();
|
||||
logger.warn.callCount.should.equal(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user