Skip to content

marcelo-lourenco/api-test-builder

Repository files navigation

API Test Builder - VS Code Extension

API Test Script Generator

Automatically generate API Test Scripts for Playwright and Cypress from Swagger Documentation.

Supports:

  • OpenAPI 3.0 version
  • Swagger 2.0 version

Usage

  1. Open the Swagger Documentation (JSON file) in VS Code;
  2. Right-click anywhere in the code editor;
  3. Click the API Test Builder menu;
  4. Click the desired option;
    • Swagger to Cypress (JavaScript)
    • Swagger to Playwright (JavaScript)
    • Swagger to Playwright (Java) *beta
    • Swagger to Playwright (Python) *beta
    • Swagger to Playwright (.Net) *beta
  5. Voilà! The extension will generate the directories and test script templates. All you need to do is adjust the indentation and add the test scenarios you want/need.

*Beta version

  • Java - requires proper definition of "import"
  • .Net - requires proper definition of "using"
  • Python - requires proper definition of "import"
  • all - requires proper indentation

Help us improve. Report a Issue.

Try the Extension

Want to try the extension but don't have a Swagger documentation file? You can use the Swagger Petstore examples:

Features

  • Generates tests: Creates test scripts based on the source specification (Swagger/OpenAPI)
  • Organizes tests by tag: Groups generated tests into folders based on the tags defined in your source file
  • Handles multiple HTTP methods: Supports GET, POST, PUT, DELETE, and other HTTP methods defined in your source file.
  • Resolves schema references ($ref): Correctly handles references within your schema definitions.
  • Generates sample requests: Creates sample request bodies based on your schema definitions.
  • Includes basic response assertions: Adds expect statements to check the response status code.
  • Clean file structure: Creates a well-organized directory structure for your tests, making them easy to manage.

Motivate us

If this is what you were looking for, please consider giving us a 5-star rating.

We love suggestions. Leave yours.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

Resources and Information

Code of CondutLicense MITSecurityChangelogDiscussions

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published