Hitch Test
Loosely coupled integration testing framework

Watch Hitch in action


About


Hitch is a new kind of integration testing framework that emphasizes realism, simplicity, isolation, speed, separation of concerns and loose coupling.

Hitch brings together the power and simplicity of Python with Jinja2, YAML and IPython.

Try out the example project:


$ git clone --recursive https://github.com/hitchtest/django-remindme.git

$ cd django-remindme/django-remindme-tests

$ curl -sSL https://hitchtest.com/init.sh > init.sh ; chmod +x init.sh ; ./init.sh
                    

Tested on Debian, Ubuntu, Arch, Fedora and Mac OS X**.

Takes roughly 20-25 minutes. May require sudo to install packages. Known issues

What does the init.sh script do?

Simple, easy to write tests


Using Yaml and Jinja2 (Why?)

{% extends "base.yml" %}
{% block test %}
- engine: engine.py:DjangoReminderTestExecutionEngine
  name: Sign up, create reminder and wait for email reminder to arrive in python {{ python_version }}
  preconditions:
    python_version: "{{ python_version }}"
  scenario:
    - Load website
    - Click: register
    - Fill form:
        id_username: django
        id_email: [email protected]
        id_password1: jazzguitar
        id_password2: jazzguitar
    - Click submit
    - Click: create
    - Fill form:
        id_description: Remind me about upcoming gig.
        id_when: 30 days
    - Click: create
    - Wait for email:
        Containing: Confirm E-mail Address
    - Confirm emails sent: 1
    - Time travel:
        Days: 30
    - Wait for email:
        Containing: Remind me about upcoming gig.
{% endblock %}

See this test on github

Powerful and terse engine


Declarative, configurable service set up

    def set_up(self):
        self.services['Django'] = hitchdjango.DjangoService(
            python=virtualenv_python,
            version=str(self.settings.get("django_version")),
            settings="remindme.settings",
            needs=[self.services['Postgres'], ]
        )

Test steps call methods defined wholly by you

    def load_website(self):
        """Navigate to website in Firefox."""
        self.driver.get(self.services['Django'].url())

    def click(self, on):
        """Click on HTML id."""
        self.driver.find_element_by_id(on).click()

See the full example engine on github