Giter Club home page Giter Club logo

tapy's Introduction

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

tapy's People

Contributors

sokolovstas avatar

Stargazers

Andrey avatar

Watchers

 avatar  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.