Code Monkey home page Code Monkey logo

keploy's Introduction

Welcome to Keploy πŸ‘‹

contributions welcome Tests Go Report Card Slack Docs

Keploy

Keploy is a no-code API testing platform that generates tests-cases and data-mocks from API calls.

Dependency-mocks are automatically generated with the recorded request/responses.

Keploy is testing itself with   Coverage Status   without writing any test-cases and data-mocks. 😎 link-to-video-demo

Quick Start

The fastest way to start with Keploy is the Gitpod-hosted version. When you're ready, you can install locally or host yourself.

One-click deploy sample URL Shortener application sample with Keploy using Gitpod

Open in Gitpod

Features

Convert API calls from any source to Test-Case : Keploy captures all the API calls and subsequent network traffic served by the application. You can use any existing API management tools like Postman, Hoppscotch, Curl to generate test-case.

  • Automatically Mocks Dependencies
  • Safely Replays all CRUD operations

Generate Test Case from API call

Native interoperability with popular testing libraries like go-test. Code coverage will be reported with existing and Keploy recorded test cases and can also be integrated in CI pipelines/infrastructure.

Generate Test Case from API call

Other Features

  • Accurate Noise Detection in responses like (timestamps, random values) to ensure high quality tests.
  • Statistical deduplication ensures that redundant testcases are not generated. WIP (ref #27).
  • Web Console to visually understand the results, update behaviour and share findings across your team.

How it works?

How it works

Keploy is added as a middleware to your application that captures and replays all network interaction served to application from any source.

Read more in detail

Installation

Start keploy server

git clone https://github.com/keploy/keploy.git && cd keploy
docker-compose up

The UI can be accessed at http://localhost:8081

Helm chart

Keploy can also be installed to your Kubernetes cluster using the Helm chart available here

Run Sample application

Demos using Echo/PostgreSQL and Gin/MongoDB are available here. For this example, we will use the Echo/PostgreSQL sample.

git clone https://github.com/keploy/samples-go && cd samples-go/echo-sql
go mod download

Start PostgreSQL instance

docker-compose up -d

Run the application

go run handler.go main.go

Generate testcases

To genereate testcases we just need to make some API calls. You can use Postman, Hoppscotch, or simply curl

1. Generate shortned url

curl --request POST \
  --url http://localhost:8080/url \
  --header 'content-type: application/json' \
  --data '{
  "url": "https://github.com"
}'

this will return the shortened url. The ts would automatically be ignored during testing because it'll always be different.

{
	"ts": 1647802058801841100,
	"url": "http://localhost:8080/GuwHCgoQ"
}

2. Redirect to original url from shortened url

curl --request GET \
  --url http://localhost:8080/GuwHCgoQ

Integration with native Go test framework

You just need 3 lines of code in your unit test file and that's it!!πŸ”₯πŸ”₯πŸ”₯

import (
	"github.com/keploy/go-sdk/keploy"
	"testing"
)
func TestKeploy(t *testing.T) {
	keploy.SetTestMode()
	go main()
	keploy.AssertTests(t)
}

Run the testcases

Note: Before running tests stop the sample application

go test -coverpkg=./... -covermode=atomic  ./...

this should show you have 74.4% coverage without writing any code!

ok      echo-psql-url-shortener 5.820s  coverage: 74.4% of statements in ./...

All of these can be visualised here - http://localhost:8081/testlist

Language Support

  • Go SDK
  • Java SDK - WIP #51
  • Typescript/Javascript SDK - WIP #61
  • Python SDK - WIP #58

Need another language support? Please raise an issue or discuss on our slack channel

Resources

πŸ€” FAQs

πŸ•΅οΈβ€οΈ Why Keploy

βš™οΈ Installation Guide

πŸ“– Contribution Guide

Community Channels

We'd love to collaborate with you to make Keploy great. To get started:

  • Slack - Discussions with the community and the team.
  • GitHub - For bug reports and feature requests.

Generic badge Generic badge Generic badge Generic badge

πŸ“Œ Our valuable ContributorsπŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» :

Thanks goes to these wonderful people (emoji key):


Shubham Jain

🚧

Sarthak

🚧

Ritik Jain

🚧

Neha Gupta

🚧

Felix-Ayush

🚧

Madhav Sikka

🚧

Unnati

🚧

Sid Shukla

🚧

Peter Georgas

🚧

Michael Grigoryan

🚧

Surya Kant

🚧

Mahesh Gupta

🚧

Naman Taneja

🚧

Rajat Sharma

🚧

Axit Patel

🚧

Tushar Malik

🚧

keploy's People

Contributors

slayerjain avatar sarthak160 avatar ayush7614 avatar nehagup avatar re-tick avatar madhavsikka avatar ditsuke avatar akshit42-hue avatar edwinwalela avatar michaelgrigoryan25 avatar petergeorgas avatar thunderboltsid avatar skant7 avatar unnati914 avatar

Watchers

 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.