Giter Club home page Giter Club logo

image


lemoncheesecake: Test Storytelling

image

image

image

image

lemoncheesecake is an end-to-end test framework for Python that brings trust around test results. It allows test developers to be very explicit about what their tests really do with logging, matchers, file attachments, etc..

Here is a test example:

import json
import requests

import lemoncheesecake.api as lcc
from lemoncheesecake.matching import *

URL  = "https://api.github.com/orgs/lemoncheesecake"

@lcc.suite("Github tests")
class github:
    @lcc.test("Test Organization end-point")
    def organization(self):
        lcc.set_step("Get lemoncheesecake organization information")
        lcc.log_info("GET %s" % URL)
        resp = requests.get(URL)
        require_that("HTTP code", resp.status_code, is_(200))
        data = resp.json()
        lcc.log_info("Response\n%s" % json.dumps(data, indent=4))

        lcc.set_step("Check API response")
        check_that_in(
            data,
            "type", is_("Organization"),
            "id", is_integer(),
            "description", is_not_none(),
            "login", is_(present()),
            "created_at", match_pattern("^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$"),
            "has_organization_projects", is_true(),
            "followers", is_(greater_than_or_equal_to(0)),
            "following", is_(greater_than_or_equal_to(0)),
            "repos_url", ends_with("/repos"),
            "issues_url", ends_with("/issues"),
            "events_url", ends_with("/events"),
            "hooks_url", ends_with("/hooks"),
            "members_url", ends_with("/members{/member}"),
            "public_members_url", ends_with("/public_members{/member}")
        )

And here are the corresponding test results:

test results

NB: in real test code, you'd better use lemoncheesecake-requests when doing HTTP / REST API testing.

Features

  • Advanced test hierarchies using suites, tests and nested suites
  • Test description and metadata: tags, properties (key=value associations) and links
  • Support for test filtering
  • Multiple reporting flavors built-in: HTML, JSON, XML, JUnit, ReportPortal, Slack notifications
  • BDD support using behave
  • Test parallelization
  • Rich CLI toolbox

lemoncheesecake is compatible with Python 3.8-3.12.

Installation

lemoncheesecake can be installed through pip:

$ pip install lemoncheesecake

For more details about installing lemoncheesecake with the non-default reporting backends, see here.

Documentation

The documentation is available on http://docs.lemoncheesecake.io.

The lemoncheesecake ecosystem

Contact

Bugs and improvement ideas are welcomed in tickets. A Google Groups forum is also available for discussions about lemoncheesecake: https://groups.google.com/forum/#!forum/lemoncheesecake.

lemoncheesecake's Projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.