错误信息:

httprunner.exceptions.ParamsError: Invalid API defined in modifySettingCrossAbroad.yml

文件内容:

- config:
    name: modify Setting CrossAbroad
    base_url: ${ENV(base_url)}
    variables:
        Cookies: ${get_cookies()}
    verify: False

- test:
    name: /portal/vdcSettingManage/modifySettingCrossAbroadClose
    variables: {}
    request:
        headers:
            Content-Type: application/json;charset=UTF-8
            Sec-Fetch-Mode: cors
            Sec-Fetch-Site: same-origin
            Cookie: $Cookies
            User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML,
                like Gecko) Chrome/79.0.3945.79 Safari/537.36
        json:
            id: 2
            settingType: CROSS_BOARD
            switchs: CLOSE
        method: POST
        url: /portal/vdcSettingManage/modifySetting
    validate:
    -   eq:
        - status_code
        - 200
    -   eq:
        - headers.Content-Type
        - application/json;charset=UTF-8
    -   eq:
        - content.code
        - '00000'
    -   eq:
        - content.msg
        - SUCCESS
    -   eq:
        - content.data
        - true

- test:
    name: /portal/vdcSettingManage/modifySettingCrossAbroadOpen
    variables: {}
    request:
      headers:
        Content-Type: application/json;charset=UTF-8
        Cookie: $Cookies
        Sec-Fetch-Mode: cors
        Sec-Fetch-Site: same-origin
        User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
      json:
        id: 2
        settingType: CROSS_BOARD
        switchs: OPEN
      method: POST
      url: /portal/vdcSettingManage/modifySetting
    validate:
      - eq:
          - status_code
          - 200
      - eq:
          - headers.Content-Type
          - application/json;charset=UTF-8
      - eq:
          - content.code
          - "00000"
      - eq:
          - content.msg
          - SUCCESS
      - eq:
          - content.data
          - true


↙↙↙阅读原文可查看相关链接,并与作者交流