-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from cdagli/master
Better README. Renamed Env Variables to be more specific
- Loading branch information
Showing
7 changed files
with
129 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
language: node_js | ||
node_js: | ||
- "node" | ||
- "node" | ||
env: | ||
global: | ||
- BROWSER_DRIVER_INSTALLER_CHROME_VERSION=67 | ||
- BROWSER_DRIVER_INSTALLER_CHROMEDRIVER_PATH=./output/chromedriver | ||
- BROWSER_DRIVER_INSTALLER_FIREFOX_VERSION=57 | ||
- BROWSER_DRIVER_INSTALLER_GECKODRIVER_PATH=./output/geckodriver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,32 @@ | ||
[![Build Status](https://travis-ci.org/unscrambl/browser-driver-installer.svg?branch=master)](https://travis-ci.org/unscrambl/browser-driver-installer) | ||
|
||
# browser-driver-installer | ||
Installs Chrome and Gecko drivers that match with the specified browser versions | ||
Installs Chrome and Gecko drivers that match with the specified browser versions. It uses the [chromedriver](https://www.npmjs.com/package/chromedriver) and [geckodriver](https://www.npmjs.com/package/geckodriver) NPM packages to download the drivers. | ||
|
||
#### Usage: | ||
|
||
**Post Install Script:** If your environment has the `BROWSER_DRIVER_INSTALLER_CHROME_VERSION`, `BROWSER_DRIVER_INSTALLER_CHROMEDRIVER_PATH`, `BROWSER_DRIVER_INSTALLER_FIREFOX_VERSION`, `BROWSER_DRIVER_INSTALLER_GECKODRIVER_PATH` variables defined, a post-install script will download the `ChromeDriver` and `GeckoDriver` executables to the specified paths automatically. | ||
|
||
|
||
**As a module:** | ||
``` | ||
const driverInstaller = require('browser-driver-installer').driverInstaller; | ||
driverInstaller(BROWSER_NAME, BROWSER_VERSION, TARGET_PATH); | ||
``` | ||
|
||
|
||
**CLI Usage:** | ||
|
||
```` | ||
Usage: index [options] | ||
Options: | ||
--browser-name <browserName> Browser to install the driver for | ||
--browser-version <browserVersion> Browser version string e.g. 65, 67.0.23 | ||
--target-path <targetPath> Path to install driver executable | ||
-h, --help output usage information | ||
```` | ||
|
||
## LICENSE | ||
[Apache 2.0](https://github.com/unscrambl/browser-driver-installer/blob/master/LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
if [[ (-n "${BROWSER_DRIVER_INSTALLER_CHROME_VERSION}") && (-n "${BROWSER_DRIVER_INSTALLER_CHROMEDRIVER_PATH}")]]; then | ||
node ./index.js --browser-name chrome \ | ||
--browser-version "$BROWSER_DRIVER_INSTALLER_CHROME_VERSION" \ | ||
--target-path "$BROWSER_DRIVER_INSTALLER_CHROMEDRIVER_PATH" | ||
else | ||
echo "Environment variables for Chrome are not set, skipping post-install for Chrome" | ||
fi | ||
|
||
if [[ (-n "${BROWSER_DRIVER_INSTALLER_FIREFOX_VERSION}") && (-n "${BROWSER_DRIVER_INSTALLER_GECKODRIVER_PATH}")]]; then | ||
node ./index.js --browser-name firefox \ | ||
--browser-version "$BROWSER_DRIVER_INSTALLER_FIREFOX_VERSION" \ | ||
--target-path "$BROWSER_DRIVER_INSTALLER_GECKODRIVER_PATH" | ||
else | ||
echo "Environment variables for Firefox are not set, skipping post-install for Firefox" | ||
fi |