Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

需求: 测试步骤的失败重试 #1146

Open
zhengtong0898 opened this issue Jan 13, 2022 · 0 comments
Open

需求: 测试步骤的失败重试 #1146

zhengtong0898 opened this issue Jan 13, 2022 · 0 comments
Assignees
Labels
pending pending for confirmation

Comments

@zhengtong0898
Copy link

zhengtong0898 commented Jan 13, 2022

背景描述

做异步接口测试时,通常是提交参数后。
需要轮训请求另外一个接口查询异步接口状态。

这种场景下就需要失败重试功能。

期望的功能特性

config:
    name: "request teststep: with error retry"
    base_url: "https://postman-echo.com"

teststeps:
-
    name: get with params
    request:
        method: GET
        url: /get
        params:
            info: "ip"
        headers:
            User-Agent: HttpRunner/${get_httprunner_version()}
    retry:
        tries: 3                                        # 失败后再尝试2次             总的尝试是3次
        delay: 5                                        # 每次间隔5秒                总的等待是15秒
    validate:
        - eq: ["status_code", 200]
        - eq: ["body.args.foo1", "bar11"]            
        - eq: ["body.args.sum_v", "3"]
        - eq: ["body.args.foo2", "bar21"]
@zhengtong0898 zhengtong0898 added the pending pending for confirmation label Jan 13, 2022
zhengtong0898 added a commit to zhengtong0898/httprunner that referenced this issue Jan 13, 2022
zhengtong0898 added a commit to zhengtong0898/httprunner that referenced this issue Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending pending for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants