This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This app integrates Jasmine JavaScript tests with the Django test framework in a simple but effective DRY way. Using it you can easily write and run tests that integrates your frontend and backend in a manner that is much easier to maintain than selenium tests interacting with full web pages.

You can either run individual jasmine spec files and check the result from within your Django test suit or open an url from your devserver and run all specs at once, checking the result on the webpage.

Getting started

  1. Add 'djasmine' to your INSTALLED_APPS:

    INSTALLED_APPS = [
        ...
        'djasmine',
    ]
    
  2. Include the djasmine URLconf in your project urls.py like this:

    url(r'^djasmine/', include('djasmine.urls')),
    
  3. Add the following to your project settings:

    import jasmine_core
    
    JASMINE_SPEC_ROOT = BASE_DIR + '/path/to/spec/files'
    
    STATICFILES_DIRS = [
        jasmine_core.__path__[0],
        JASMINE_SPEC_ROOT,
    ]
    
  4. Now you need to get your site’s JavasSript files included by the Djasmine runner view. You probably already have them written out in your 'base.html' template or similar. In order to keep DRY you don’t want to provide this list again in some test setup file, and with Djasmine you don’t have to. Instead break out the list of javascript tags into a special top-level template called 'javascripts.html' and include this in your 'base.html' (or similar). This template will also be picked up by the spec runner code. If you are using e g compressor preprocessing tags the template include approach allows you to use these also for the test running code.

For more specialized needs you can provide your own 'djasmine/specrunner.html' template.

Running Jasmine specs from Django tests

Create your Django tests by using djasmine.testcase.JasmineRunnerTestCase as base class for your test cases. There is one required class property, webdriver, that should specify the Selenium WebDriver class you wish to use for the test, e g selenium.webdriver.firefox.webdriver.WebDriver.

Run and check result of a Jasmine spec file with the assertSpecPasses method, which takes one argument: the name of your spec file.

Example:

from djasmine.testcase import JasmineRunnerTestCase
from selenium.webdriver.firefox.webdriver import WebDriver


class MyIntegrationTest(JasmineRunnerTestCase):
    webdriver = WebDriver

    def test_all_works_nicely(self):
        self.assertSpecPasses('my_tests.spec.js')  # Runs everything in this spec file and checks result

        ...
        (other checks of backend state possible here)
        ...
Release History

Release History

0.2.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
djasmine-0.2.3.tar.gz (4.8 kB) Copy SHA256 Checksum SHA256 Source Dec 21, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting