Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#38 - Selenium binary host configuration #39

Merged
merged 3 commits into from
Dec 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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