GithubHelp home page GithubHelp logo

chutney-testing / chutney Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 3.0 16.3 MB

An opinionated test application to help you practice Specification by Example

Home Page: https://www.chutney-testing.com/

License: Apache License 2.0

Nix 0.01% Dockerfile 0.02% Java 65.83% Gherkin 3.28% JavaScript 0.11% TypeScript 11.19% HTML 3.48% SCSS 1.49% Kotlin 14.58% Shell 0.02%
acceptance-test-driven-development hacktoberfest specification-by-example test-automation test-driven-development testing-tools ubiquitous-language

chutney's Introduction

Chutney

Spice up your spec , Better taste your app !

Build Codacy Badge Coverage Status Maven Central


Summary


Introduction

Chutney aims to test deployed software in order to validate functional requirements.

Chutney scenarios are declarative written with a kotlin dsl. They provide functional requirements and technical details (needed for automation) in a single view.

Chutney is also released as a standalone application including a test execution engine and a a web front end to consult test reports.

Technical details are provided by generic Actions (such as HTTP, AMQP, MongoDB, Kafka, Selenium, etc.)
Those Actions are extensions, and you can easily develop yours, even proprietary or non-generic one, and include them in your own release.

In addition, Chutney provide SpEL evaluation and extensible Function in order to ease the use of managing scenario data like JSON path or Date comparison.

Find out more in the documentation !

Still asking yourself "Why another test tool ?"


Installation

Locally

In order to install Chutney on your machine, you can use Java or Docker. See Start a server.

On premise

See installation on premise, for details if you want to customize your own version of chutney server.


Scenario Example

You can find all the documentation of how to write a scenario here

Example of a scenario

Here is an example of a scenario written in Kotlin.

    const val HTTP_TARGET_NAME = "HTTP_TARGET"

    const val FILMS_ENDPOINT = "/films"
    private val JSON_CONTENT_TYPE = "Content-Type" to "application/json";

    var FILM = """
    {
        "title": "Castle in the Sky",
        "director": "Hayao Miyazaki",
        "rating": "%rating%",
        "category": "fiction"
    }
    """

    val http_scenario = Scenario(title = "Films library") {
        Given("I save a new film") {
            HttpPostAction(
                target = HTTP_TARGET_NAME,
                uri = FILMS_ENDPOINT,
                body = FILM.trimIndent(),
                headers = mapOf(
                    JSON_CONTENT_TYPE
                ),
                validations = mapOf(
                    statusValidation(201)
                ),
                outputs = mapOf(
                    "filmId" to "#body".elEval()
                )
            )
        }
    
        When ("I update rating") {
            HttpPatchAction(
                target = HTTP_TARGET_NAME,
                uri = "$FILMS_ENDPOINT/\${#filmId}",
                body = """
                    {
                    "rating": "79",
                    }
                """.trimIndent(),
                headers = mapOf(
                    JSON_CONTENT_TYPE
                ),
                validations = mapOf(
                    statusValidation(200)
                )
            )
        }
    
        Then ("I check that rating was updated") {
            Step("I get film by id") {
                HttpGetAction(
                    target = HTTP_TARGET_NAME,
                    uri = "$FILMS_ENDPOINT/\${#filmId}",
                    headers = mapOf(
                        JSON_CONTENT_TYPE
                    ),
                    validations = mapOf(
                        statusValidation(200)
                    ),
                    outputs = mapOf(
                        "title" to "jsonPath(#body, '\$.title')".spEL(),
                        "rating" to "jsonPath(#body, '\$.rating')".spEL()
                    )
                )
            }
        Step ("I check rating"){
            AssertAction(
                asserts = listOf(
                    "title.equals('Castle in the Sky')".spEL(),
                    "rating.equals('79')".spEL()
                )
            )
        }
    }
  • In this example the scenario will save the content of FILM to an external server.
  • Then it will update it, fetch it and finally verify that the FILM has indeed been updated.
  • In this scenario we perform Http Actions, you can find all available Chutney Actions here
  • You can find some other example with jms, kafka, rabbit or sql here

Documentation

Get the official documentation for more information about how Chutney works.


Contributing ?

PRs Welcome

See the Getting started, which document how to install and setup the required environment for developing

You don't need to be a developer to contribute, nor do much, you can simply:

To help you start, we invite you to read Contributing, which gives you rules and code conventions to respect

To contribute to this documentation (README, CONTRIBUTING, etc.), we conform to the CommonMark Spec

Support

We’re using Discussions as a place to connect with members of our - slow pace growing - community. We hope that you:

  • Ask questions you’re wondering about,
  • Share ideas,
  • Engage with other community members,
  • Welcome others, be friendly and open-minded !

Contributors

Core contributors :

We strive to provide a benevolent environment and support any contribution.

chutney's People

Contributors

96radhikajadhav avatar adrien-gogois avatar amalmtt avatar bessonm avatar boddissattva avatar delaunayalex avatar dependabot-preview[bot] avatar dependabot[bot] avatar geva2072 avatar gissehel avatar karimgl avatar ledoyen avatar nbrouand avatar owerfelli avatar pkode avatar rbenyoussef avatar redouaeelalami avatar tulinhnguyen avatar yueshigao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chutney's Issues

πŸš€ | Move security report to Enedis

Which part of our software stack is concerned by the feature ?

Chutney

Describe your use case

I open this issue just to remember it. I will probably do it asap.

Is your feature request related to a problem ?

No response

Describe the solution you'd like

  • link security report to Enedis mail.
  • add security report to documentation website

Link to examples

No response

πŸ› | JIRA connection broken when no proxy is declared

Which part of our software stack is concerned by the problem ?

Chutney

What happened?

When no proxy is delcared on JIRA configuration :

  • On camapign page, there is an error message when JIRA id exists
  • No update is done on campaign/scenarios with JIRA ids

Steps to reproduce

  • JIRA configuration without proxy conf
  • Campaign/Scenarios with JIRA ids

Relevant logs and/or screenshots/GIFs

No response

Possible fixes

No response

Version

2.7.0

What browsers are you seeing the problem on ?

No response

What OS did you use ?

No response

πŸš€ | Assign a scenario to a campaign from the scenario UI

Which part of our software stack is concerned by the feature ?

Chutney

Describe your use case

When I open a scenario page, I would like to be notified if the scenario is not assign to any campaign, and be able to assign it to a campaign from the same page.

Is your feature request related to a problem ?

No response

Describe the solution you'd like

Maybe it would be enough to be able to assign campaigns from a "add tag UI" based on the list of existing campaigns.

Link to examples

Original issue : chutney-testing/chutney-legacy#1255

Support SslBundle configuration provided by spring-boot-3.XπŸš€ |

Which part of our software stack is concerned by the feature ?

Chutney

Description

Spring Boot 3.1 introduces the concept of SSL bundles for configuring and consuming custom SSL trust material, such as keystores, certificates, and private keys. Once configured, a bundle can be applied to one or more connections using configuration properties or APIs

I suggest to make it possible to declare a SslBundles configuration bloc that can be referenced from the targets such as HTTP or Kafka

Bundles are more concise, can handle PEM format (simplier than packaging in jks everytime)

Solution

Making:

{
    "name": "ghibli_movies_http_service",
    "url": "https://my.http.service:443/",
    "properties": {
        "username": "myUsername",
        "user": "myUsername", // 
        "userPassword": "myPassword",
        "password": "myPassword", // 
        "trustStore": "/home/APP/security/mytruststore.jks",
        "trustStorePassword": "myTrustStorePassword",
        "keyStore": "/home/APP/security/mykeyStore.jks",
        "keyStorePassword": "mykeyStorePassword",
        "keyPassword": "myKeyStoreKeyPassword",
        "proxy": "https://myproxy:3128"
    }
}

looks more like

{
    "name": "ghibli_movies_http_service",
    "url": "https://my.http.service:443/",
    "properties": {
        "username": "myUsername",
        "user": "myUsername", 
        "userPassword": "myPassword",
        "password": "myPassword", 
        "sslBundle": "my-http-service-bundle"
        "proxy": "https://myproxy:3128"
    }
}

where "my-http-service-bundle" is declared in a specific bloc like (yaml format but can be json)

  ssl:
    bundle:
      pem:
        server-bundle:
          keystore:
            certificate: "classpath:security/server.crt"
            private-key: "classpath:security/server.key"
          truststore:
            certificate: "classpath:security/ac-chain.pem"

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.