httprunner icon indicating copy to clipboard operation
httprunner copied to clipboard

3.X是否还提供了API给外部调用

Open justcby opened this issue 5 years ago • 5 comments
trafficstars

背景描述 重点描述遇到的问题: 比如以下的参数化不支持了吗?? ... 3.X之后的版本还支持提供API给外部进行扩展吗?

期望的功能特性 希望继续支持API调用

示例描述(可选) 结合示例进行描述,可让开发者更准确理解你的需求。

justcby avatar Jun 18 '20 07:06 justcby

@justcby 已经提供了的,待补充文档。 可以看下 https://github.com/httprunner/httprunner/blob/v3.1.0/httprunner/runner.py#L311 https://github.com/httprunner/httprunner/blob/v3.1.0/httprunner/runner.py#L360

debugtalk avatar Jun 21 '20 07:06 debugtalk

@debugtalk 请问下调用get_summary()方法能在断言失败时调用成功吗?我目前在run_testcase()后面调用get_summary(),但是如果运行用例时断言失败后,就调不到get_summary()了。另外在调用api时能自定义传入测试报告的路径名称,或者是否使用allure等等可控制的参数吗?

slowchen avatar Jul 09 '20 06:07 slowchen

问题描述

同样的问题,如果执行testcase中发现问题,会直接报错,而且报错信息不够直观。例如:

# 前面还有对应的python的Traceback
assert status_code equal 200(int)	==> fail
check_item: status_code
check_value: 0(int)
assert_method: equal
expect_value: 200(int)
assert body.form.foo1 equal bar1(str)	==> fail
check_item: body.form.foo1
check_value: None(NoneType)
assert_method: equal
expect_value: bar1(str)
assert body.form.foo2 equal bar21(str)	==> fail
check_item: body.form.foo2
check_value: None(NoneType)
assert_method: equal
expect_value: bar21(str)

期望的功能特性

希望能够支持类似httprunner2.x版本的API调用,不只是run_xxx()

gaoyangzhang avatar Jul 15 '20 08:07 gaoyangzhang

@debugtalk ,能否提供一个例子。

lijuelijue avatar Feb 01 '21 12:02 lijuelijue

4.x是否有该特性的支持的版本计划呢? @debugtalk

BoxTester avatar Sep 09 '22 09:09 BoxTester