Skip to main content

Declarative test runner using YAML and jinja2.

Project description

HitchTest

HitchTest is a part of the hitch testing framework which compiles and runs YAML (and optionally jinja2) tests like this:

{% 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: django@reinhardt.com
        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 %}

There is no magic here. Each of these steps calls a python method, defined by you in the specified execution engine class, like so:

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

Features

  • Integrates with IPython.

  • Pretty stacktraces and test results.

  • Quiet mode.

  • Integrated and easily overriden test settings.

Why YAML + Jinja2?

This is to more easily maintain separation of concerns. Enforcing the use of YAML keeps the test scripts declarative, and all of the execution code is kept centralized in the engine.

This also makes reading, writing, adding metadata to and and parsing test cases much easier.

Combining YAML with jinja2 gives you the power to deduplicate test case code while still maintaining comprehensibility and simplicity.

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

hitchtest-0.7.5.tar.gz (15.1 kB view details)

Uploaded Source

File details

Details for the file hitchtest-0.7.5.tar.gz.

File metadata

  • Download URL: hitchtest-0.7.5.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for hitchtest-0.7.5.tar.gz
Algorithm Hash digest
SHA256 b5be60205188abcf4e96251163db6bd0f67846b5414d80286c6c0a2f5bce9562
MD5 f14d7d0f480b0a15905552719ec6207b
BLAKE2b-256 105c1f41bf6038636756215cbfc1c34e62a4f147ba2f5dc99edd7ec841539df1

See more details on using hashes here.

Supported by

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