pybrowserstack-screenshots

api wrapper and python client for Browserstack Screenshots, including phantomCSS support


Keywords
browserstack, screenshots, phantomCSS, python, screenshot, testing, visual-regression
License
MIT
Install
pip install pybrowserstack-screenshots==0.1

Documentation

pybrowserstack-screenshots

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.

Installation

  1. pip install pybrowserstack-screenshots

Usage

  1. Create a config file for the device/os/browser combinations you wish to screenshot. See example_config/ for examples.
  2. 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.

PhantomCSS (experimental)

  1. Download baseline screenshots:
python client.py --config <config_file> --phantomcss
  1. Run client.py a second time to generate new screenshots
  2. Test for visual regressions between the two sets using PhantomCSS:
casperjs test comparator.js

client.py params

-a, --auth <username:token>
-c, --config <config_file>
-p, --phantomcss

other requirements

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