Python HttpRunner3.x 使用 py 编写脚本时,怎么在 step 中引入别的用例,我看官方文档没有相关的说明

深圳陈柏霖 · 2021年01月18日 · 最后由 深圳陈柏霖 回复于 2021年01月18日 · 4427 次阅读

https://www.ontheway.cool/HttpRunner3DocsForCN/concepts/testcase-layer/

官方文档中是演示旧版的示例,有大佬知道的可以告知下不?

config:
    name: "request methods testcase: reference testcase"
    id: create_user
    base_url: "http://127.0.0.1:5000"
    variables:
        uid: 9001
        device_sn: "TESTCASE_CREATE_XXX"
    export: session_token

teststeps:
-
    name: create user and check result
    variables:
        foo1: testcase_ref_bar1
        expect_foo1: testcase_ref_bar1
    testcase: testcases/demo_testcase_request.yml
    export:
        - session_token
-
    name: check_and_create
    variables:
        token: $session_token
    testcase: testcases/deps/check_and_create.yml
共收到 6 条回复 时间 点赞
我去催饭 回复

感谢感谢,谢谢解答!👏

在路上 回复

感谢感谢,刚接触在学习,谢谢解答!👋

testcase/testsuite file should be YAML/JSON format, invalid format file: path/to/demo_testcase_request_test.py

YAML/JSON 格式测试用例,只能引用 YAML/JSON 格式用例。

如果用 python 脚本写用例,可以参考:

在路上 回复

那请问下,这里 yaml 中的

testcase: testcases/deps/check_and_create.yml

如果用 py 格式写,应该怎么使用呢?

这个格式就是 httprunner v3.x 的格式,跟 2 是不一样的

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册