Package: buster-selenium
Buster.js Selenium and Python Test IntegrationThis package provides wrappers for theBuster.jsserver and test
runner that integrate bits of selenium to control the capture ofBuster slaves.  It also provides wrappers for running Buster.js
tests as a part of aPythontest suite and further integration withzope.testrunnerfor doing test discovery andtesting layersfor
controlling thebuster-serverand capturing Buster.JS browser
slaves.Managingbuster-serverand Capturing Browser SlavesThebuster_selenium.case.BusterJSTestCaseclass is a sub-class ofunittest.TestCaseand can be used to create Python test cases that
will run a Buster.JS test suite corresponding to onebuster.jstest
configuration:>>> from buster_selenium import case
>>> def suite():
>>>     suite = unittest.TestSuite()
...     suite.addTest(
...         case.BusterJSTestCase('/path/to/buster.js'))
...     return suiteThe test case will startbuster-server, launch a browser, and
capture a browser slave in the testsetUp.  Then it will invokebuster-testpassing thebuster.jsconfig file and will report
failure ifbuster-testexits with a status code of1or will
report erro if it exits with any other non-zero status code.  Finally,
it will shutdown the browser slave and thebuster-server.TheBusterJSTestCaseclass uses a few environment variables to
control how thebuster-testexecutable is invoked and what is done
with its output:BUSTER_TEST_EXECUTABLEIf defined, the value of this will be used as the path to thebuster-testexecutable 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
firstbuster-testavailable onPATHwill be used.BUSTER_TEST_OPTIONSIf defined, the value of this variable will be passed to Python’sshlex.splitand passed as arguments/options to thebuster-testexecutable.  This can be useful, for example, to use differentbuster-test –reportoptions.BUSTER_TEST_STDOUTIf defined, the stdout output of thebuster-testexecutable will
be written to this file.BUSTER_SERVER_EXECUTABLELikeBUSTER_TEST_EXECUTABLE, if defined, the path given will be
used as thebuster-serverexecutable.  Otherwise the firstbuster-serverfound onPATHwill be used.BUSTER_SLAVE_BROWSER_EXECUTABLEIf defined, the executable at the path given will be invoked as a
slave browser and captured by thebuster-serverpreviously
started.  If theselenium.webdriverpackage is availble, setting
this overrides the default behavior of capturing a browser slave via
Selenium.BUSTER_SLAVE_BROWSER_OPTIONSIf defined, the value of this variable will be passed to Python’sshlex.splitand passed as arguments/options to theBUSTER_SLAVE_BROWSER_EXECUTABLEexecutable.BUSTER_SLAVE_SELENIUM_DRIVERIf theselenium.webdriverpackage is availble and this variable is
set, the value will be used to retrieve a Selenium driver from theselenium.webdriver Python module.  By default,Firefoxis used.BUSTER_SLAVE_SELENIUM_ARGSIf defined, the value of this variable will be passed to Python’sshlex.splitand passed as positional arguments to theselenium.webdriverused.BUSTER_SLAVE_SELENIUM_GRID_BROWSERNAME, BUSTER_SLAVE_SELENIUM_GRID_VERSION, BUSTER_SLAVE_SELENIUM_GRID_PLATFORM, BUSTER_SLAVE_SELENIUM_GRID_JAVASCRIPTENABLEDIf usingSelenium Gridby settingBUSTER_SLAVE_SELENIUM_DRIVER=Remoteand this variable defined,
these values will be used to modify the values for thebrowserName,version,platform, andjavascriptEnabledkeys
in theselenium.webdriver.DesiredCapabilitiesdictionaries.  This
is useful to run your buster tests against different OS’s, browsers,
and versions.Buster.JS Test DiscoveryThebuster-seleniumpackage provides abuster-testrunnerconsole
script which adds discovery of Buster.JS tests to thezope.testrunnersupport forautomatically finding teststhroughout a project.  In particular, it will create test suites from
any directory under a validbuster-testrunner--test-paththat has abuster.jsfile:$ buster-testrunner --test-path=/path/to/project/module --test-path=/path/to/project/other-moduleSee thezope.testrunnerdocs orbuster-testrunner--helpfor more
details on controlling test discovery and which tests are run.Sharingbuster-serverand Browser Slave Capture Between TestsThebuster_selenium.layermodule useszope.testrunnersupport fortesting layersto startbuster-server, launch a browser, and
capture a browser slave and use those for allbuster-testruns when
the tests are run withbuster-testrunner.  This can help speed up
the running of multiple Buster.JS test suites while still providing
clean mangement of thebuster-serverand captured browser slaves.
These layers are used automatically when using the test discovery
described above.Managing Browser Slaves with Selenium WebdriverIf the selenium Python package is available, by default theBusterJSTestCaseand testing layer support described above will
useselenium.webdriverto open, capture, and clean up a browser
slave.  The way thatselenium.webdriverlaunches browsers provides
an additional degree of isolation from user extensions, profiles,
themes, and other add-ons and provides greater isolation for Buster.JS
tests.Changelog0.1 - 2012-09-23Initial release