python api wrapper and client for Browserstack Screenshots API including PhantomCSS support. Starts screenshot jobs at Browserstack and downloads the screenshots when they are complete. Tests for visual regressions using PhantomCSS.
Note, you must have Screenshot API access enabled on your account.
- pip install pybrowserstack-screenshots
- Create a config file for the device/os/browser combinations you wish to screenshot. See example_config/ for examples.
- Start the browserstack job and download baseline screenshots:
python client.py --config <config_file> --auth <username:token>
Note that "auth" attribute (browserstack username and token) is optional. When not specified, values will be taken from "main_config.properties" where all configuration variables are stored.
- Download baseline screenshots:
python client.py --config <config_file> --phantomcss
- Run client.py a second time to generate new screenshots
- Test for visual regressions between the two sets using PhantomCSS:
casperjs test comparator.js
-a, --auth <username:token>
-c, --config <config_file>
-p, --phantomcss
comparator.js requires casperjs: http://casperjs.readthedocs.org/en/latest/ If not initialised, the submodule PhantomCSS can be initialised with
git submodule update --init --recursive
For more information see http://www.browserstack.com/screenshots/api
For a full list of browsers: http://www.browserstack.com/screenshots/browsers.json