Skip to main content

Jasmine integration for selenium.

Project description

The gocept.jasmine distribution

Jasmine integration for selenium.

Usage

You need two things to run jasmine tests with selenium:

  • A test app which requires your resources and jasmine test files:

    class MyTestApp(gocept.jasmine.jasmine.TestApp):
    
        def need_resources(self):
            # Require your resources here
            my.package.resource.need()
            my.package.tests.jasmine_tests.need()
    
        @property
        def body(self):
            # HTML setup for your tests goes here
            return '<div id="my_container"></div>'
  • A TestCase with the jasmine layer:

    class MyJasmineTestCase(gocept.jasmine.jasmine.TestCase):
    
        layer = gocept.jasmine.jasmine.get_layer(MyTestApp())
    
        def test_integration(self):
            self.run_jasmine()

The important things here are, that the get_layer function is given your jasmine app and that the returned Layer is used on your TestCase.

In your Test, simple run run_jasmine, which will open the TestApp in your Browser. The TestApp renders your body and includes all needed resources and then runs the jasmine tests. run_jasmine will wait for these tests to finish and the report success or failure. Jasmine tracebacks and error details are visible through the selenium error handling.

Debugging

You can set the debug flag on your test case to get a pdb debugger right after the start of the jasmine tests. This lets you debug your jasmine tests within your browser:

class MyJasmineTestCase(gocept.jasmine.jasmine.TestCase):

    layer = gocept.jasmine.jasmine.get_layer(MyTestApp())
    debug = True

    def test_integration(self):
        self.run_jasmine()

Developing gocept.jasmine

Author:

Sebastian Wehrmann <sw@gocept.com>

PyPI page:

http://pypi.python.org/pypi/gocept.jasmine/

Issues:

https://github.com/gocept/gocept.jasmine/issues

Source code:

https://github.com/gocept/gocept.jasmine

Current change log:

https://raw.githubusercontent.com/gocept/gocept.jasmine/master/CHANGES.txt

Change log for gocept.jasmine

0.7 (2019-12-09)

  • Remove version pinnings in buildout as this is a library which should run with the newest versions of its dependencies.

  • Add a simple self test.

  • Require pytest < 5 to keep Python 2 support.

  • Migrate to Github.

  • Support Python 3.7 and 3.8.

0.6 (2017-03-21)

  • Update to fanstatic 1.0a to use minifier.

  • Ensure compatibility with setuptools >= 30.0.

0.5.1 (2014-06-10)

  • The last two releases (0.4 and 0.5) were brown bag releases, so we need to make a new one.

0.5 (2014-06-10)

  • Add JS library to mock ajax calls during jasmine tests.

0.4 (2014-06-06)

  • Make it possible to run multiple TestApps.

0.3 (2013-08-27)

  • Fixed a problem where the testrunner finished sucessfully before all jasmine tests finished in browser.

0.2 (2013-08-17)

  • Added helper function to ease test layer setup.

  • Made it easier to debug jasmine tests in the browser.

0.1 (2013-08-16)

initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gocept.jasmine-0.7.tar.gz (34.6 kB view details)

Uploaded Source

File details

Details for the file gocept.jasmine-0.7.tar.gz.

File metadata

  • Download URL: gocept.jasmine-0.7.tar.gz
  • Upload date:
  • Size: 34.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5

File hashes

Hashes for gocept.jasmine-0.7.tar.gz
Algorithm Hash digest
SHA256 509d07c384c7059b79fb321756e65a6b7684ac9a6b6c9916d05fd0bb166c05f9
MD5 6c9bd8cd315ac591625f749d5a96f76e
BLAKE2b-256 2bb4a9f61c6f9be1c4ea9fdd16e538307f2b8e3d9ce103f0a9ffb73d89fd46d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page