Socket
Socket
Sign inDemoInstall

rw-tapy

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rw-tapy

## Описание


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

TAPY

Описание

TAPY - Test API with YAML

Примеры

Примеры использования можно посмотреть в папке /test

API

Каждый файл может содержать зависимости. Перед стартом будет построен граф и выполнение пойдет в топологическом порядке

depends_on:
  - auth

Каждый файл и каждый шаг может содержать следующие настройки:

root: https://jsonplaceholder.typicode.com # переустановать root
vars: # назначить переменные
  testKey: TEST${$makeAlphaId(5).toUpperCase()}
headers: # установаить заголовки в следующие fetch
  "Authorization": "Bearer ${json.token}"

Шаги описываются структурой:

# выполняются в самом начале файла
beforeAll:
  - get: url # GET запрос
    ...
steps:
  - sleep: milliseconds # Подождать перед выполнением
  - post: url # POST запрос
    log: varName/json # вывести в лог переменную varName или json ответ
    body: # тело запроса
      title: title value string
      user_id: 2
    json: varName # сохранить ответ в переменную
    status: 200 # проверить код ответа
    check: # проверить после выполнение запросов
      - json.title === 'title value string'
      - json.user_id === 2
    eval: # выполняет eval в контексте
      - m1.date = "2023-09-25T00:00:00Z"
  - put: url # PUT запрос
    ...
  - get: url # GET запрос
    ...
  - delete: url # DELETE запрос
    ...

# выполняются после всех шагов
afterAll:
  - get: url # GET запрос
    ...

# cleanup выполняется в обратном топологическом порядке даже если тесты не прошли
cleanup:
  - get: url # GET запрос
    ...

Запуск

npx rw-tapy --help
npx rw-tapy <options> ./test

FAQs

Package last updated on 19 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc