A Hubot script to take screenshots with BrowserStack.
me > hubot screenshot me http://www.google.com/
hubot > Started generating screenshots in http://www.browserstack.com/screenshots/d804f186e460dc4f2a30849a9686c3a8c4276c21
- Add
hubot-browserstack
to dependencies.
npm install --save hubot-browserstack
- Update
external-scripts.json
["hubot-browserstack"]
Grab your BrowserStack Username and Access Key from Your Account > Automate.
HUBOT_BROWSER_STACK_USERNAME=$(Your BrowserStack Username)
HUBOT_BROWSER_STACK_ACCESS_KEY=$(Your BrowserStack Access Key)
You can set custom settings to generate screenshots.
Firstly, set the file path for Browserstack settings.
HUBOT_BROWSER_STACK_SETTINGS=$HOME/data/mysettings.json
Then, put a json in the file.
{
"callback_url": "http://staging.example.com",
"win_res": "1024x768",
"mac_res": "1920x1080",
"quality": "compressed",
"wait_time": 5,
"orientation": "portrait",
}
You can find available parameters on Browserstack Official API Docs
Default browsers are listed in browsers.json of this module.
If you prefer other browsers, you can specify JSON path with HUBOT_BROWSER_STACK_DEFAULT_BROWSERS
.
HUBOT_BROWSER_STACK_DEFAULT_BROWSERS=$HOME/data/mybrowers.json
Make sure relative path will be resolved from process's working directory.