Skip to main content
Glama
felipeassis10

bdd-regression-test-generator

bdd-regression-test-generator

Автономный агент, который анализирует конечные точки REST API и контракты сервисов OpenAPI/Swagger для генерации:

  • BDD-спецификации Gherkin (файлы .feature), описывающие все основные сценарии и пограничные случаи.

  • Скрипты регрессионного тестирования на TypeScript (готовые к Jest + Playwright), которые можно запускать против реальных сервисов.

Он предоставляет два интерфейса:

Интерфейс

Описание

CLI

bdd-gen generate --input <spec> --output <dir>

MCP-сервер

Сервер Model Context Protocol, который можно подключить к любому MCP-совместимому хосту (например, IBM Bob, Claude Desktop)


Возможности

  • Разбирает контракты OpenAPI 3.x и Swagger 2.0 (JSON или YAML).

  • Извлекает все пути, HTTP-методы, параметры, тела запросов и схемы ответов.

  • Генерирует один файл .feature для каждой группы тегов конечных точек.

  • Генерирует один файл *.spec.ts для каждой группы тегов конечных точек с полностью типизированными тестовыми сценариями Jest.

  • Поддерживает внедрение пользовательского базового URL на этапе генерации.

  • MCP-сервер предоставляет инструменты analyze_contract, generate_gherkin и generate_tests.


Related MCP server: Swagger Testcase MCP

Установка

npm install
npm run build

Чтобы использовать в качестве глобального CLI после сборки:

npm link

Использование CLI

# Generate both Gherkin and Jest tests from an OpenAPI YAML spec
bdd-gen generate --input ./petstore.yaml --output ./generated --baseUrl https://api.example.com

# Generate only Gherkin feature files
bdd-gen generate --input ./petstore.json --output ./generated --only gherkin

# Generate only Jest test scripts
bdd-gen generate --input ./petstore.json --output ./generated --only jest

# Analyze a contract and print a summary (no file generation)
bdd-gen analyze --input ./petstore.yaml

Параметры CLI

Параметр

Псевдоним

Описание

По умолчанию

--input <path>

-i

Путь к файлу контракта OpenAPI/Swagger

обязательно

--output <dir>

-o

Каталог, в который будут записаны сгенерированные файлы

./generated

--baseUrl <url>

-b

Базовый URL для встраивания в сгенерированные тестовые файлы

http://localhost:3000

--only <type>

Генерировать только gherkin или jest (не указывайте для обоих)

оба

--verbose

-v

Включить подробное логирование

false


MCP-сервер

Запустите MCP-сервер с помощью:

npm run mcp

Сервер регистрирует следующие инструменты:

analyze_contract

Разбирает контракт OpenAPI/Swagger из пути к файлу или сырой строки JSON/YAML.

Входные данные:

{ "source": "./petstore.yaml" }

Выходные данные: Структурированный JSON-объект ContractSummary с путями, методами, параметрами и схемами.


generate_gherkin

Генерирует содержимое Gherkin .feature из разобранного контракта.

Входные данные:

{
  "source": "./petstore.yaml",
  "outputDir": "./generated"
}

Выходные данные: Список путей записанных файлов .feature.


generate_tests

Генерирует тестовые скрипты TypeScript Jest из разобранного контракта.

Входные данные:

{
  "source": "./petstore.yaml",
  "outputDir": "./generated",
  "baseUrl": "https://api.example.com"
}

Выходные данные: Список путей записанных файлов .spec.ts.


Структура проекта

bdd-regression-test-generator/
├── src/
│   ├── parser/
│   │   └── contract-analyzer.ts   # OpenAPI/Swagger parser and extractor
│   ├── generator/
│   │   ├── gherkin-builder.ts     # Gherkin .feature file builder
│   │   └── jest-builder.ts        # TypeScript Jest spec builder
│   ├── mcp/
│   │   └── server.ts              # MCP server exposing generation tools
│   └── cli.ts                     # Commander-based CLI entry point
├── tests/
│   └── generator.test.ts          # Unit tests for parser and generators
├── dist/                          # Compiled output (after build)
├── package.json
├── tsconfig.json
└── README.md

Запуск тестов

npm test

С покрытием:

npm run test:coverage

Пример: сгенерированный Gherkin

Feature: Pets

  Background:
    Given the API base URL is "https://api.example.com"

  Scenario: GET /pets - list all pets - success
    Given I have valid authentication credentials
    When I send a GET request to "/pets"
    Then the response status code should be 200
    And the response body should match the "PetList" schema

  Scenario: GET /pets - list all pets - unauthorized
    Given I have invalid or missing authentication credentials
    When I send a GET request to "/pets"
    Then the response status code should be 401

Пример: сгенерированный тест Jest

import axios from 'axios';

const BASE_URL = 'https://api.example.com';

describe('Pets', () => {
  describe('GET /pets', () => {
    it('should return 200 for a valid request', async () => {
      const response = await axios.get(`${BASE_URL}/pets`);
      expect(response.status).toBe(200);
    });
  });
});

Лицензия

MIT

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server for the comprehensive analysis of Swagger 2.0 and OpenAPI 3.x contracts. It allows users to extract detailed information about endpoints, request/response schemas, parameters, and security configurations from API documentation.
  • A
    license
    A
    quality
    F
    maintenance
    MCP server for API test case generation from Swagger/OpenAPI specs. Parses Swagger 2.0 and OpenAPI 3.x, generates test cases across 8 categories (positive, negative, boundary, auth, security, idempotency, pagination, business logic), and exports to Postman, TestRail, Allure, k6, pytest, Gherkin, and CSV. Supports internal corporate APIs with auth headers. Auto-saves export files to your working di
    10
    11
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    High-performance MCP server for OpenAPI specifications that parses specs, diffs versions, tracks dependencies, and generates code (TypeScript, Rust, Python).
    22
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for AI access to Swagger by SmartBear.

  • MCP server for AI access to SmartBear tools, including BugSnag, Reflect, Swagger, PactFlow, QTM4J.

  • Generate a typed SDK, CLI, and MCP server from any OpenAPI or GraphQL spec, and keep them current.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/felipeassis10/bdd-regression-test-generator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server