Giter Site home page Giter Site logo

maxkissgen / api-testing-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rwth-acis/api-testing-bot

0.0 0.0 0.0 215 KB

REST API test modeling (chat-) bot usable on GitHub & in the CAE. Uses OpenAI Codex for natural language test description understanding.

Shell 3.28% Java 95.78% Batchfile 0.36% Dockerfile 0.58%

api-testing-bot's Introduction


API Testing Bot

⚙️ Setup/Usage

First, set up the bot in the Social-Bot-Framework. Both the bot model and the NLU training data can be found in the bot-model directory. The bot uses a backend service which is included in this repository. The easiest way to use the service is to build (or pull) the Docker image and run the service as a container. The bot can be used in different ways and on different platforms:

1. Usage with CAE & RocketChat

If the bot is a member of a RocketChat channel that is linked to a CAE project, test cases can be modeled via chat. The bot can be triggered by sending a message such as "model a test". As soon as the modeling is completed, the test case is forwarded to the CAE and proposed there in the Test Editor.

Dependencies:

2. Usage on GitHub

The bot may be used within GitHub repositories by connecting it to a GitHub app. Therefore, the app id and a private key are required. Please note that the private key needs to be converted from PKCS#1 to PKCS#8. In the bot model, the Authentication Token of the GitHub issue or pull request messenger needs to be set to [App Id]:[App Private Key]. Use the private key in PKCS#8 format, but remove the first and last line before copying it. Also, set the webhook URL of the app to .../apitestingbot/github/webhook/{gitHubAppId}.

Then, the bot can be triggered within issues/pull requests by sending a message such as "model a test". Once a test case has been modeled, the bot generates Java JUnit test code and comments it.

In pull requests, the bot may also propose spec-based test cases if it can access the developed service's OpenAPI documentation. Read the repository adjustment guide for more information.

Dependencies:

🐳 Docker Environment Variables

Depending on the use case different environment variables are required:

Environment Variable Description Required?
BOT_MANAGER_URL REST API URL of Bot Manager Service ending with /SBFManager. Yes
CODEX_API_TOKEN Token for accessing the OpenAI/Codex API. Yes
CAE_BACKEND_URL REST API URL of CAE Model Persistence Service ending with /CAE. Only in 1. Use-case
GITHUB_APP_ID Id of GitHub app that the bot should use. Only in 2. Use-case
GITHUB_APP_PRIVATE_KEY Private key of GitHub app that the bot should use (already needs to be converted to PKCS#8). Only in 2. Use-case

api-testing-bot's People

Contributors

phil-cd avatar dependabot[bot] 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.