Metadata-Version: 1.0
Name: lazr.testing
Version: 0.1.2
Summary: A collection of testing helpers.
Home-page: https://launchpad.net/lazr.testing
Author: LAZR Developers
Author-email: lazr-developers@lists.launchpad.net
License: LGPL v3
Download-URL: https://launchpad.net/lazr.testing/+download
Description: 
        ..
            This file is part of lazr.testing.
        
            lazr.testing is free software: you can redistribute it and/or modify it
            under the terms of the GNU Lesser General Public License as published by
            the Free Software Foundation, version 3 of the License.
        
            lazr.testing is distributed in the hope that it will be useful, but
            WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
            or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
            License for more details.
        
            You should have received a copy of the GNU Lesser General Public License
            along with lazr.testing.  If not, see <http://www.gnu.org/licenses/>.
        
        LAZR testing
        ************
        
        Please see https://dev.launchpad.net/LazrStyleGuide and
        https://dev.launchpad.net/Hacking for how to develop in this
        package.
        
        
        Javascript tests with JsTestDriver
        ==================================
        
        ``lazr.testing`` includes support for running Javascript tests with
        the help of JsTestDriver_, and failures and errors are reported back
        to your unittest-based test runner as if they were failures and errors
        of a unittest TestCase.
        
        To actually run the tests, a browser must be started (if not running)
        and captured by the JsTestDriver server. Since we generally want to do
        this only once, the JsTestDriver server is started and stopped as a
        subprocess using ``zope.testing`` support for layers.
        
        JsTestDriver supports outputing test results in an XML-based format,
        which we parse and feed into a ``TestResult`` instance from unittest.
        
        .. _JsTestDriver: http://code.google.com/p/js-test-driver/
        
        Writing tests
        -------------
        
        Please refer to the `JsTestDriver TestCase`_ documentation on how to
        write tests that are supported by JsTestDriver.
        
        Additionally, the ``lazr-js`` project has some examples of running
        ``YUI Test``-based tests under JsTestDriver.
        
        .. _JsTestDriver TestCase: http://code.google.com/p/js-test-driver/wiki/TestCase
        
        Getting your Javascript tests to be run as part of your test suite is
        somewhat trivial, provided that you are already using ``zope.testing``
        as your test runner (see also `Future Plans`_). All you have to do is
        to define a ``JsTestDriverTestCase`` subclass with a
        ``config_filename`` attribute that points to a ``JsTestDriver``
        configuration file. For example::
        
          from lazr.testing.jstestdriver import JsTestDriverTestCase
        
          class JsTestDriverSelfTest(JsTestDriverTestCase):
              config_filename = os.path.abspath(os.path.join(os.path.dirname(__file__),
                                                             "js", "tests.conf"))
        
        Running tests
        -------------
        
        In order to actually run the tests you need to specify the location
        where JsTestDriver can be found. This can be done by exporting an
        environment variable::
        
          JSTESTDRIVER="java -jar /path/to/JsTestDriver.jar" ./bin/test
        
        By default, as said above, the test layer will fire up a JsTestDriver
        server and connect your default browser to it. Then the actual test
        run will execute the JsTestDriver as a client connecting back to that
        server to drive the Javascript tests. This variable **must** always be
        present, regardless of the other variables described below.
        
        You can control the port used by the server with another environment
        variable. The default is to start the server on port 4224::
        
          JSTESTDRIVER_PORT="10001"
        
        It is also possible (and very handy!) to have a long-running
        JsTestDriver server and connect one or more browser to it manually. If
        you want to do that, you have to export another variable telling where
        your JsTestDriver server is running (hint: this could even be a remote
        server)::
        
          JSTESTDRIVER_SERVER="http://localhost:10001"
        
        Controlling the browser that will be started can also be done by
        setting the ``BROWSER`` environment variable to the full path of your
        browser's executable.
        
        If your default browser is Firefox, it can be annoying that every time
        you run the tests in the background a new tab opens and Firefox
        switches to it automatically, disrupting your browsing. You can
        disable that by Preferences -> Tabs and disabling the option named
        "When I open a link in a new tab, switch to it immediately". It might
        be also interesting to enable the option "Open new windows in a new
        tab instead" if it's not enabled yet.
        
        Finally, if you're just too annoyed that every test run opens new
        tabs, you have the option of having a long-running JsTestDriver server
        as described above and manually connect to it. That way, only a single
        tab of your browser will be used and every test run will re-use that
        tab.
        
        Future Plans
        ------------
        
        In the future, the test layer might be replaced by
        testresources_ and the custom XML parsing might be replaced by
        using a subunit_ stream filter.
        
        .. _testresources: https://launchpad.net/testresources
        .. _subunit: https://launchpad.net/subunit
        
        =====================
        NEWS for lazr.testing
        =====================
        
        0.1.2 (2010-09-06)
        ==================
        
        - Add compatibility with JsTestDriver 1.2.2. Not compatible with earlier
          versions of JsTestDriver anymore.
        
        - Don't wait for a browser, if JsTestDriverLayer doesn't start the
          browser. (LP: #627413)
        
        0.1.1 (2009-10-16)
        ==================
        
        - Brown bag, botched NEWS release.
        
        0.1.0 (2009-10-16)
        ==================
        
        - Initial release
        
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
