zoukankan      html  css  js  c++  java
  • 3. HttpRunner运行测试用例

    以多种方式运行测试用例

    执⾏单个测试⽤例

    > hrun filepath/testcase.yml
    

    执⾏多个测试⽤例

    > hrun testcase1.yml testcase2.yml
    

    执⾏整个文件夹下的用例

    > hrun folder_path
    

    运行测试脚本

    基于之前生成的json、yaml文件,通过命令行终端cd到用例所在目录,执行hrun + 用例名称即可运行测试脚本。

    > hrun index.yml
    INFO     HttpRunner version: 2.5.7
    INFO     Start to run testcase: testcase description
    /index
    INFO     GET http://localhost.charlesproxy.com:8000/index
    INFO     status_code: 200, response_time(ms): 42.89 ms, response_length: 32 bytes
    
    .
    
    ----------------------------------------------------------------------
    Ran 1 test in 0.048s
    
    OK
    INFO     Start to render Html report ...
    INFO     Generated Html report: D:api-auto-testhrun_demo
    eports2020-10-29_17_55_03.html
    Sentry is attempting to send 0 pending error messages
    Waiting up to 2 seconds
    Press Ctrl-Break to quit
    

    在console中可以看到请求的概要信息, 包括请求的地址、状态码、运行的用例数量、生成的测试报告路径...信息, 如需要在控制台查看请求具体信息, 可在运行时加上--log-level debug参数。


    查看测试报告

    执行完测试用例会在当前目录创建一个reports文件夹,里面会有一个按时间戳生成的html格式报告文件,我们打开看一哈
    test_report

    点开测试步骤detail列的log-1可以查看请求的具体信息

    请求数据(Request)
    请求信息

    响应数据(Response)
    响应数据

    断言校验字段(Validate):
    校验信息

  • 相关阅读:
    台湾大学李宏毅机器学习教程
    自编码器AE & 变分自编码器VAE
    深度信念网络(DBN)和堆叠自编码(SAE)、深度自编码器(DAE)的区别
    花式自动编码器
    迁移和域自适应
    MMD :maximum mean discrepancy
    数据可视化工具t-SNE
    线性判别分析(LDA)
    弱监督学习
    如何生成不重复的随机数
  • 原文地址:https://www.cnblogs.com/kyle-/p/13898116.html
Copyright © 2011-2022 走看看