Skip to content

Introduction

zapy_logo

The pythonic REST client and testing tool.


Documentation: https://docs.zapy.dev

Github repo: https://github.com/ZapyLabs/zapy-sdk

FAQ: https://zapy.dev/faq


Introducing Zapy, the pythonic REST client and testing tool. With an intuitive GUI, deep Python integration, and seamless collaboration via Git; it simplifies testing while offering unparalleled flexibility and robustness. Streamline your workflow, minimize code duplication, and elevate your API testing with Zapy.

The key features are:

  • Simplified testing: Build, modify and send requests using an intuitive GUI, and invoke them using code on your test suits. Minimize code duplication and efforts.
  • Programmatic flexibility: Empowered by the Python ecosystem, write and import code, use Jinja2 for templating, Jupyter Notebooks for chaining, httpx for messaging, pytest/unittest for test suits and more.
  • Integration with CI/CD and Testing Tools: Run it with your favorite CI/CD and testing or automation tool. Such as Playwright, pytest, Behave and Robot Framework.

Requests

Integrated on VSCode using an extension.

first look

Stores

Stores enable the persistence and inspection of Python data for use in multiple requests, including the creation and management of environment variables.

stores

Hooks

Hooks can be global or request-specific, allowing interception and modification of requests, such as for authentication.

from zapy import requests

@requests.hooks.pre_request
async def on_each_request(httpx_args):
    httpx_args['auth'] = ('alice', 'ecila123')
    print(httpx_args)

Chaining

Chaining runs a sequence of requests with one click, using responses from one request in the next. It also offers the ability to use conditionals or to resume from a failed step.

chaining

Integration test

Requests and their tests can be invoked directly on your scripts or tests.

from pathlib import Path
import unittest

from zapy.utils import module

class TestScript(unittest.IsolatedAsyncioTestCase):
    async def test_chain_success(self):
        rel_path = Path('tests/assets')
        chain = await module.load_ipynb(rel_path / 'chain_import.ipynb', variables={
            'rel_path': rel_path
        })