Skip to main content

graphql & restful / http(s) tools

Project description

前置

  1. 安装allure并配置好环境变量
  2. 项目根目录新建 hooks.py 实现动态扩展函数
  3. 编写测试文件代码
  4. 执行测试

作用

graphql, restful HTTP/HTTPS 接口测试工具,需要编写代码

example

# testcase.py

from gruntest.grunner import Grunner
from gruntest.schemas import Config, TestStep, RequestSchema


class TestRunner(Grunner):
    config = Config(
        base_header={"Host": "49.232.203.244:1339"}
    )
    steps = [
        TestStep(
            name='百度',
            request=RequestSchema(
                url='http://www.httpbin.org/get',
                method='get',
                headers={"token": "123"},
                params={"limit": 5, "page": 1}
            ),
            extra={"code": "$.args.limit"}
        ),
        TestStep(
            name='百度',
            request=RequestSchema(
                url='http://www.httpbin.org/get',
                method='get',
                headers={"token": "123"},
                params={"limit": 5, "page": "${sum2('$code')}"}
            ),
            extra={"code": "$.args.limit"},
            expect={"$.code": "code"}
        )
    ]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gruntest-0.1.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gruntest-0.1.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file gruntest-0.1.1.tar.gz.

File metadata

  • Download URL: gruntest-0.1.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.4 Windows/10

File hashes

Hashes for gruntest-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7b213053e31a68cd956650e15d7524eec85ac0ed9bbd20e572637421d6de763b
MD5 314fe66fffbf65478dadfe93b3102c5e
BLAKE2b-256 3d8a4a783bc3829cbded3d4d4787b52457a1a73586c0bf45d1e6ab28bc12f99d

See more details on using hashes here.

File details

Details for the file gruntest-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gruntest-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.4 Windows/10

File hashes

Hashes for gruntest-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 050f483bcf936320d21ee5f5cc83be6c82ef79cb7801d6662304dd41a52aa0ee
MD5 2c70021804f84e2db29cf1aee7c75ec6
BLAKE2b-256 0ddfc155dde3fd2aad6e0b7f77707b15dc0de77ac77a72b1f160752232eb7c6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page