From b58a345c4fc1bb240d4f1555f477908ca341de96 Mon Sep 17 00:00:00 2001 From: Marc Buils Date: Tue, 13 Dec 2016 17:45:02 +0100 Subject: [PATCH 1/3] #38 - Selenium binary host configuration Add an optional environment variable to use a custom Selendroid binary host. --- lib/installer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/installer.js b/lib/installer.js index e9b3687..7086cd9 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -6,7 +6,8 @@ import log from './logger'; import crypto from 'crypto'; const SE_VER = "0.17.0"; -const SE_DOWNLOAD = `http://repo1.maven.org/maven2/io/selendroid/selendroid-standalone/${SE_VER}/selendroid-standalone-${SE_VER}-with-dependencies.jar`; +const SE_DOWNLOAD_CDNURL = process.env.APPIUM_SELENDROID_CDNURL || "http://repo1.maven.org/maven2/io/selendroid/selendroid-standalone"; +const SE_DOWNLOAD = `${SE_DOWNLOAD_CDNURL}/${SE_VER}/selendroid-standalone-${SE_VER}-with-dependencies.jar`; const SE_DOWNLOAD_SHA256 = "7cf7163ac47f1c46eff95b62f78b58c1dabdec534acc6632da3784739f6e9d82"; const SE_DIR = path.resolve(__dirname, "..", "..", "selendroid"); const SE_DOWNLOAD_DIR = path.resolve(SE_DIR, "download"); From 3448eb38bed63e580257ba44cfbe9e1329bf1893 Mon Sep 17 00:00:00 2001 From: Marc Buils Date: Tue, 13 Dec 2016 19:19:30 +0100 Subject: [PATCH 2/3] #38 - Selenium binary host configuration Selenium binary host configuration with npm arguments or environment variable. Thanks jlipps for this remark ! --- lib/installer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/installer.js b/lib/installer.js index 7086cd9..4afef5a 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -6,7 +6,9 @@ import log from './logger'; import crypto from 'crypto'; const SE_VER = "0.17.0"; -const SE_DOWNLOAD_CDNURL = process.env.APPIUM_SELENDROID_CDNURL || "http://repo1.maven.org/maven2/io/selendroid/selendroid-standalone"; +const SE_DOWNLOAD_CDNURL = process.env.npm_config_selendroid_driver_cdnurl || + process.env.SELENDROID_DRIVER_CDNURL || + "http://repo1.maven.org/maven2/io/selendroid/selendroid-standalone"; const SE_DOWNLOAD = `${SE_DOWNLOAD_CDNURL}/${SE_VER}/selendroid-standalone-${SE_VER}-with-dependencies.jar`; const SE_DOWNLOAD_SHA256 = "7cf7163ac47f1c46eff95b62f78b58c1dabdec534acc6632da3784739f6e9d82"; const SE_DIR = path.resolve(__dirname, "..", "..", "selendroid"); From b65f5a5893407b889cb8308e141595dace4a5c24 Mon Sep 17 00:00:00 2001 From: Marc Buils Date: Tue, 13 Dec 2016 19:30:46 +0100 Subject: [PATCH 3/3] #38 - Selenium binary host configuration Update README.md to add the custom binaries url configuration --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 47b18eb..fadf1fc 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,26 @@ The following methods are implemented by the `appium-selendroid-driver`, either | `unlock ()` | | `updateSettings (settings)` | +### Custom binaries url + +To use a mirror of the Selendroid driver binaries use npm config property `selendroid_driver_cdnurl`. +Default is `http://repo1.maven.org/maven2/io/selendroid/selendroid-standalone`. + +```bash +npm install appium-selendroid-driver --selendroid_driver_cdnurl=http://repo2.maven.org/maven2/io/selendroid/selendroid-standalone +``` + +Or add the property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file. + +```bash +selendroid_driver_cdnurl=http://repo2.maven.org/maven2/io/selendroid/selendroid-standalone +``` + +Another option is to use PATH variable `SELENDROID_DRIVER_CDNURL`. + +```bash +SELENDROID_DRIVER_CDNURL=http://repo2.maven.org/maven2/io/selendroid/selendroid-standalone npm install appium-selendroid-driver +``` ### Working on the package