Skip to main content

A command-line tool for generating Tavern test cases from Swagger API specifications.

Project description

# Swagern

Swagern is a command-line tool that automates the process of generating API test cases from a given Swagger or other API specification files. It leverages the power of fuzzy logic to match user-defined test case descriptions with the corresponding API endpoints defined in the specification file. The output is a set of Tavern YAML files that can be directly used to run API tests.

## Features

  • Fuzzy Matching: Swagern automatically maps user-defined test cases to API endpoints using fuzzy logic, allowing for more flexible test case definitions.

  • Customizable Output: Specify output directories or use the default location.

  • Integration with Various API Specifications: While initially built for Swagger files, Swagern aims to support various API specifications.

  • Environment Variable Mapping: Use a mapper file to define and load environment variables into your tests.

## Installation

Install Swagern using pip:

`bash pip install swagern ` ## Options

### –input Path to input test cases in YAML format. This is a required parameter.

### –output Path to the output directory where the Tavern test files will be generated. This is an optional parameter, and the default location is the tests directory in the current working directory.

### –mapper Path to the mapper YAML file, used for defining and loading environment variables into your tests.

### –api-spec Path to the Swagger or other API specifications file. This is an optional parameter. If not provided, Swagern will look for a default file path.

## Usage

Use the generate command to create Tavern YAML files based on your input file and specifications:

`bash swagern generate --input path/to/test_cases.yaml --output path/to/output-dir --mapper path/to/mapper-file --api-spec path/to/swagger.json `

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swagern-0.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swagern-0.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file swagern-0.1.tar.gz.

File metadata

  • Download URL: swagern-0.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for swagern-0.1.tar.gz
Algorithm Hash digest
SHA256 ebc9b5fcc2436846c8969d56efe2df3f47b8b92f8c8b2476e1474e27d4a2f6b1
MD5 b0e41dde0fbdfcfa32c1b7e21209b118
BLAKE2b-256 060d21cea3e83bf8151d87ab66b1f364cb765f6b3a28d62556e70b9915109a5b

See more details on using hashes here.

File details

Details for the file swagern-0.1-py3-none-any.whl.

File metadata

  • Download URL: swagern-0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for swagern-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c480ddbcc9adcaca9345740df7403013c4b64961a35b9cc3e2c3afe60d53c864
MD5 6e650f4013af06863862f31cb8f59954
BLAKE2b-256 575696402d5ce8f3e5136d745aea994eb5574c0e4e0d74ad178a77afd197e4a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page