Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install buster-selenium

How to install buster-selenium

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install buster-selenium
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
0.1 Available View build log
Linux (64-bit)
0.1 Available View build log
Lastest release
version 0.1 on Nov 21st, 2012

Buster.js Selenium and Python Test Integration

This package provides wrappers for the Buster.js server and test runner that integrate bits of selenium to control the capture of Buster slaves. It also provides wrappers for running Buster.js tests as a part of a Python test suite and further integration with zope.testrunner for doing test discovery and testing layers for controlling the buster-server and capturing Buster.JS browser slaves.

Managing buster-server and Capturing Browser Slaves

The buster_selenium.case.BusterJSTestCase class is a sub-class of unittest.TestCase and can be used to create Python test cases that will run a Buster.JS test suite corresponding to one buster.js test configuration:

>>> from buster_selenium import case
>>> def suite():
>>>     suite = unittest.TestSuite()
...     suite.addTest(
...         case.BusterJSTestCase('/path/to/buster.js'))
...     return suite

The test case will start buster-server, launch a browser, and capture a browser slave in the test setUp. Then it will invoke buster-test passing the buster.js config file and will report failure if buster-test exits with a status code of 1 or will report erro if it exits with any other non-zero status code. Finally, it will shutdown the browser slave and the buster-server.

The BusterJSTestCase class uses a few environment variables to control how the buster-test executable is invoked and what is done with its output:

If defined, the value of this will be used as the path to the buster-test executable to be used to run the tests. Useful if you're installing/building Buster.JS as a part of your build/deployment environment. If this variable is not defined, the first buster-test available on PATH will be used.
If defined, the value of this variable will be passed to Python's shlex.split and passed as arguments/options to the buster-test executable. This can be useful, for example, to use different buster-test --report options.
If defined, the stdout output of the buster-test executable will be written to this file.
Like BUSTER_TEST_EXECUTABLE, if defined, the path given will be used as the buster-server executable. Otherwise the first buster-server found on PATH will be used.
If defined, the executable at the path given will be invoked as a slave browser and captured by the buster-server previously started. If the selenium.webdriver package is availble, setting this overrides the default behavior of capturing a browser slave via Selenium.
If defined, the value of this variable will be passed to Python's shlex.split and passed as arguments/options to the BUSTER_SLAVE_BROWSER_EXECUTABLE executable.
If the selenium.webdriver package is availble and this variable is set, the value will be used to retrieve a Selenium driver from the selenium.webdriver Python module. By default, Firefox is used.
If defined, the value of this variable will be passed to Python's shlex.split and passed as positional arguments to the selenium.webdriver used.
If using Selenium Grid by setting BUSTER_SLAVE_SELENIUM_DRIVER=Remote and this variable defined, these values will be used to modify the values for the browserName, version, platform, and javascriptEnabled keys in the selenium.webdriver.DesiredCapabilities dictionaries. This is useful to run your buster tests against different OS's, browsers, and versions.

Buster.JS Test Discovery

The buster-selenium package provides a buster-testrunner console script which adds discovery of Buster.JS tests to the zope.testrunner support for automatically finding tests throughout a project. In particular, it will create test suites from any directory under a valid buster-testrunner --test-path that has a buster.js file:

$ buster-testrunner --test-path=/path/to/project/module --test-path=/path/to/project/other-module

See the zope.testrunner docs or buster-testrunner --help for more details on controlling test discovery and which tests are run.

Sharing buster-server and Browser Slave Capture Between Tests

The buster_selenium.layer module uses zope.testrunner support for testing layers to start buster-server, launch a browser, and capture a browser slave and use those for all buster-test runs when the tests are run with buster-testrunner. This can help speed up the running of multiple Buster.JS test suites while still providing clean mangement of the buster-server and captured browser slaves. These layers are used automatically when using the test discovery described above.

Managing Browser Slaves with Selenium Webdriver

If the selenium Python package is available, by default the BusterJSTestCase and testing layer support described above will use selenium.webdriver to open, capture, and clean up a browser slave. The way that selenium.webdriver launches browsers provides an additional degree of isolation from user extensions, profiles, themes, and other add-ons and provides greater isolation for Buster.JS tests.


0.1 - 2012-09-23
  • Initial release

Subscribe to package updates

Last updated Nov 21st, 2012

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.