Git Product home page Git Product logo

hyysguyang / zerocode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from authorjapps/zerocode

0.0 1.0 0.0 4.42 MB

A community-developed, free, open source, microservices API automation and load testing framework built using JUnit core runners for Http REST, SOAP, Security, Database, Kafka and much more. Zerocode Open Source enables you to create, change, orchestrate and maintain your automated test cases declaratively with absolute ease.

Home Page: https://zerocode.io

License: Apache License 2.0

Java 99.98% Dockerfile 0.02%

zerocode's Introduction

Zerocode Logo

Automated API testing has never been so easy

API Performance Testing Twitter Follow

Latest release:🏹 Maven
Continuous Integration: Build Status
Issue Discussions: Slack
Mailing List: Mailing List
License: Apache 2.0
LinkedIn: Zerocode

Zerocode Open Source makes it easy to create, change, orchestrate and maintain automated tests with the absolute minimum overhead for REST, SOAP, Kafka Real Time Data Streams and much more. Tests created in Zerocode Open Source can be easily shared between teams for reviewing, editing, and versioning. The platform incorporates the best feedback and suggestions from the community to make it incredibly powerful, and we’re seeing rapid adoption across the developer/tester community

Quick Links

To get started with Zerocode Open Source and its features, visit

Maven Dependency

Introduction

Zerocode Open Source is a lightweight, simple and extensible framework for writing test intentions in a simple JSON or YAML format that facilitates both declarative configuration and automation.

Put simply, Zerocode is a solution for all API Development pain points. The objective is to bring simplicity to API automation. The framework provides a unified solution to manage response validations, target API invocations, perform load/stress testing and perform security testing using a the simple domain specific languages (DSL) JSON and YAML.

For example, if your REST API URL https://localhost:8080/api/v1/customers/123 with GET method and "Content-Type": "application/json" returns the following payload and a http status code 200(OK) ,

Response:
{
    "id": 123,
    "type": "Premium High Value",
    "addresses": [
        {
            "type":"home",
            "line1":"10 Random St"
        }
    ]
}

then, Zerocode Open Source can be easily used to validate API using as follows:

The beauty here is, we can use the payload/headers structure for validation as it is without any manipulation or use a flat JSON path to skip the hassles of the entire object hierarchies.

Validators

Using YAML

---
url: api/v1/customers/123
method: GET
request:
  headers:
    Content-Type: application/json
retry:
  max: 3
  delay: 1000
validators:
- field: "$.status"
  value: 200
- field: "$.body.type"
  value: Premium High Value
- field: "$.body.addresses[0].line1"
  value: 10 Random St

or

Using JSON

{
  "url": "api/v1/customers/123",
  "method": "GET",
  "request": {
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "retry": {
    "max": 3,
    "delay": 1000
  },
  "validators": [
    {
      "field": "$.status",
      "value": 200
    },
    {
      "field": "$.body.type",
      "value": "Premium High Value"
    },
    {
      "field": "$.body.addresses[0].line1",
      "value": "10 Random St"
    }
  ]
}

Matchers

Using YAML

---
url: api/v1/customers/123
method: GET
request:
  headers:
    Content-Type: application/json
retry:
  max: 3
  delay: 1000
verify:
  status: 200
  headers:
    Content-Type:
    - application/json; charset=utf-8
  body:
    id: 123
    type: Premium High Value
    addresses:
    - type: Billing
      line1: 10 Random St
verifyMode: LENIENT

or

Using JSON

{
  "url": "api/v1/customers/123",
  "method": "GET",
  "request": {
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "retry": {
    "max": 3,
    "delay": 1000
  },
  "verify": {
    "status": 200,
    "headers": {
      "Content-Type" : [ "application/json; charset=utf-8" ]
    },
    "body": {
      "id": 123,
      "type": "Premium High Value",
      "addresses": [
        {
          "type": "Billing",
          "line1": "10 Random St"
        }
      ]
    }    
  },
  "verifyMode": "STRICT"
}

The test can then be run simply by pointing to the above JSON/YAML file from a Junit @Test method.

   @Test
   @Scenario("test_customer_get_api.yml")
   public void getCustomer_happyCase(){
        // No code goes here
   }

The bottom line is that Zerocode Open Source makes automated API testing declarative and simple. If you’d like to learn more, visit the quick-start guide or user's guide to get started testing - fast!

Zerocode Open Source is used by many companies such as Vocalink, HSBC, HomeOffice(Gov) and many others to achieve an accurate production drop of their microservices. Learn more about Validators Vs Matchers here.

Happy testing!

zerocode's People

Contributors

authorjapps avatar nirmalchandra avatar bartrobeyns avatar vkjha2000 avatar dinesh76in avatar sparrowv avatar officiallysameer avatar santhoshtpixler avatar siddhagalaxy avatar jbonn360 avatar kristin-smith avatar dandalavinod avatar ddingel avatar jneate avatar macrocks avatar respondsid avatar marcelo-xavier-bl avatar vishalckc avatar deblockt avatar cooljavadev avatar arunvelusamyd avatar saurabhvalsangkar avatar anishjha93 avatar kabarret avatar samsuffit avatar bethecodewithyou avatar lankor avatar helloausrine avatar dependabot[bot] avatar ankita2210 avatar

Watchers

James Cloos avatar

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.