Created
September 26, 2016 21:48
-
-
Save hdavidzhu/f72d0d93b79ab0ef57950c9a41f72522 to your computer and use it in GitHub Desktop.
20160926-setup.coffee
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
# Load the Chrome extension and convert to base64 format. | |
# This is specific to how the node-selenium webdriver sets up its capabilities. | |
# Refer to http://stackoverflow.com/a/27278322/2204868 for more info. | |
data = fs.readFileSync '/tmp/location/of/extension.crx' | |
encodedExtension = data.toString 'base64' | |
capabilities = | |
browserName: 'chrome' | |
chromeOptions: | |
extensions: [encodedExtension] # This needs to be a base64 String array of our extensions. | |
# This is the driver you can now use to power all of your tests. | |
@driver = new webdriver | |
.Builder() | |
.withCapabilities(capabilities) | |
.build() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment