Skip to content

Commit

Permalink
Merge pull request #39 from marcbuils/patch-1
Browse files Browse the repository at this point in the history
#38 - Selenium binary host configuration
  • Loading branch information
jlipps authored Dec 13, 2016
2 parents 96cb573 + b65f5a5 commit ff47a79
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion lib/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ 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.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");
const SE_DOWNLOAD_DIR = path.resolve(SE_DIR, "download");
Expand Down

0 comments on commit ff47a79

Please sign in to comment.