Skip to main content

A framework for testing yunce offline plan

Project description

icecream 说明

icecream 用于http相关接口测试,通过类似postman的描述文件进行接口测试,并进行测试结果收集,目前支持yaml描述

支持功能

  • 支持yaml文件用例描述
  • 支持全局变量,环境变量,局部变量
  • 支持如postman的prerequest, test
  • 支持python自定义函数
  • 支持python全系统语法及所有第三方包
  • 支持常用assert断言格式

使用方法

  • code方案
    • http请求(区分上层yaml)
      • ice.request 主请求,可以使用ice.response进行响应
      • ice.send_request, 用于直接返回的请求,不可以使用ice.response进行响应
    • 变量应用
      • ice.environment.set() get
      • ice.variables.set() get
      • ice.globals.set() get
    • 断言使用
      • ice.test.less
      • ice.test.eq
  • yaml组织方案
    • 查看samples样例

离线报告

计划目录结构
│─tesp_plan
│   ├─测试111
│   └─测试222
└─start_test.py
  • 安装云测执行包:pip install icecream_cmri
  • 命令行执行
    • 指定计划执行 icecream_hrunner --plan_dir=plan --plan_name=testname
    • 所有计划执行 icecream_hrunner --plan_dir=plan
  • 代码执行
import os
from datetime import datetime
from icecream.core.html_runner import Html_Runner


def main():
    plan_dir = 'tesp_plan'
    report_dir = os.path.join(os.getcwd(), 'report', datetime.now().strftime('%Y%m%d%H%M%S'))
    plan_names = os.listdir(plan_dir)
    for plan_name in plan_names:
        html_runner = Html_Runner(plan_path=os.path.join(plan_dir, plan_name), report_dir=report_dir)
        html_runner.run()
        html_runner.generat_report()


if __name__ == '__main__':
    main()

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

icecream_cmri-1.2.1-py2.py3-none-any.whl (2.1 MB view details)

Uploaded Python 2Python 3

File details

Details for the file icecream_cmri-1.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: icecream_cmri-1.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for icecream_cmri-1.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 47c41937011071c807e300cd67a049369b8c860cb095159f1fea07229aec4ed3
MD5 50527e03077f25ba5d423164a46e534d
BLAKE2b-256 2ffda283b10788543d81a45cfa4309fcd3e4a4fbee8e59734613777cbe36a18e

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