Zapy SDK for Zapy REST client
Project description
Zapy REST client - SDK
Zapy REST Client is VSCode extension to test APIs. Zapy SDK the python library that allows the client to operate. It aims to solve the duplication issue on integration testing.
Documentation: https://docs.zapy.dev
Github repo: https://github.com/ZapyLabs/zapy-sdk
FAQ: https://zapy.dev/faq
Main feature:
- You can use python on your requests and import any script or library.
- Your request files can be imported and executed in python.
- As it's used with pytest, it's ready for CI/CD and can be combined with Playwright or any other library.
- It's file based so it's git ready.
- It uses Jinja2 or Python syntax.
- Rapid development using low code user interface.
- Request chaining powered by Jupyter Notebooks.
Usage
Install the python library under a virtual environment.
pip install zapy-sdk
Install the VSCode Extension.
Create a .zapy
file, for example my_first_request.zapy
and open it using VSCode.
Requests
Integrated on VSCode using an extension.
Stores
Stores enable the persistence and inspection of Python data for use in multiple requests, including the creation and management of environment variables.
Hooks
Hooks can be global or request-specific, allowing interception and modification of requests, such as for authentication.
from zapy.requests import hooks, HttpxArguments
@hooks.pre_request
async def on_each_request(httpx_args: HttpxArguments):
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.
Integration test
Requests and their tests can be invoked directly on your scripts or tests.
from pathlib import Path
import pytest
from zapy import requests
from zapy.utils import module
@pytest.mark.asyncio
async def test_single():
request = requests.from_path("request1.zapy")
response = await request.send()
response.json()
@pytest.mark.asyncio
async def test_chain(self):
rel_path = Path('tests/assets')
chain = await module.load_ipynb(
rel_path / 'chain_import.ipynb',
variables={
'rel_path': rel_path
},
)
Privacy
Data for authentication is collected when using the Zapy VSCode Extension. No personal or request data is collected.
License
The Zapy SDK is licensed under the terms of the Business Source License 1.1 (BSL). The Zapy VSCode Extension is under End User Service Agreement.
By installing or running this software you expressly agree with the terms of use.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file zapy_sdk-0.0.1a1.tar.gz
.
File metadata
- Download URL: zapy_sdk-0.0.1a1.tar.gz
- Upload date:
- Size: 103.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc35be8dd9814a007e029fa5d2aba473d753f9d2bbb456d2cd15523b0caafe69 |
|
MD5 | b62fb802b6a077647a1a05318f128b7d |
|
BLAKE2b-256 | d198540c64fcc4f1e0096c093864e209c528b1ebfe978b27dcfd04ce8798cf32 |
File details
Details for the file zapy_sdk-0.0.1a1-py3-none-any.whl
.
File metadata
- Download URL: zapy_sdk-0.0.1a1-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 990d0e9dbb7140fb69b4583d9e78fe49604b7f6870638f95f1f614e768e06834 |
|
MD5 | 074ad10f000854fa1fbdd888d513ab8f |
|
BLAKE2b-256 | 959789f658f02860b8468e81f06b14de613c84a43e43486125b176abaf4852a3 |