Skip to content

No code API testing platform. Create unit tests and data mocks from API calls.

License

Notifications You must be signed in to change notification settings

asadlambdatest/keploy

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

95 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Welcome to Keploy πŸ‘‹

contributions welcome Tests Go Report Card Slack Docs Gitpod

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

🚧

About

No code API testing platform. Create unit tests and data mocks from API calls.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 97.1%
  • Smarty 1.9%
  • Dockerfile 1.0%