跳转到主要内容

一个监听器,它会将堆栈跟踪打印到控制台,以更快地找到出现失败的代码部分。

项目描述

robotframework-stacktrace

为RF >= 4.0设计的监听器,它会将堆栈跟踪打印到控制台,以更快地找到出现失败的代码部分。

安装

pip install robotframework-stacktrace

使用

robot --listener RobotStackTracer <your file.robot>

示例

旧控制台输出

❯ robot -d logs TestCases/14_Browser/01_CarConfig.robot
==============================================================================
01 CarConfig
==============================================================================
Configure Car with Pass                                               | FAIL |
TimeoutError: page.selectOption: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector ""Basismodell" >> ../.. >> select"
  selector resolved to visible <select _ngcontent-c7="" class="maxWidth ng-untouched ng…>…</select>
  selecting specified option(s)
    did not find some options - waiting...
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
Configure Car with wrong Acc                                          | FAIL |
TimeoutError: page.check: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector "//span[contains(text(),'aABS')]/../input"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
Configure Car with car Acc                                            | FAIL |
TimeoutError: page.click: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector "[href="/config/summary/wrong"]"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
01 CarConfig                                                          | FAIL |
3 tests, 0 passed, 3 failed
==============================================================================
Output:  /Source/RF-Schulung/02_RobotFiles/logs/output.xml
Log:     /Source/RF-Schulung/02_RobotFiles/logs/log.html
Report:  /Source/RF-Schulung/02_RobotFiles/logs/report.html

新堆栈跟踪输出

❯ robot -d logs --listener RobotStackTracer TestCases/14_Browser/01_CarConfig.robot
==============================================================================
01 CarConfig
==============================================================================
Configure Car with Pass                                               ...
  Traceback (most recent call last):
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File  /Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:23
    T:  Configure Car with Pass
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File  /Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:28
      Select aMinigolf as model
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File  /Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/functional_keywords.resource:14
      Select Options By    ${select_CarBaseModel}    text    ${basemodel}
      |  ${select_CarBaseModel} = "Basismodell" >> ../.. >> select (str)
      |  ${basemodel} = aMinigolf (str)
______________________________________________________________________________
Configure Car with Pass                                               | FAIL |
TimeoutError: page.selectOption: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector ""Basismodell" >> ../.. >> select"
  selector resolved to visible <select _ngcontent-c7="" class="maxWidth ng-untouched ng…>…</select>
  selecting specified option(s)
    did not find some options - waiting...
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
Configure Car with wrong Acc                                          ....
  Traceback (most recent call last):
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File  /Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:38
    T:  Configure Car with wrong Acc
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File  /Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:43
      Select Accessory    aABS
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File  /Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/functional_keywords.resource:38
      Check Checkbox    //span[contains(text(),'${accessory}')]/../input
      |  //span[contains(text(),'${accessory}')]/../input = //span[contains(text(),'aABS')]/../input (str)
______________________________________________________________________________
Configure Car with wrong Acc                                          | FAIL |
TimeoutError: page.check: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector "//span[contains(text(),'aABS')]/../input"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
Configure Car with car Acc                                            ..
  Traceback (most recent call last):
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File  /Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:51
    T:  Configure Car with car Acc
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File  /Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:62
      Set wrong Car Name    ${car}
      |  ${car} = My New Car (str)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File  /Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/functional_keywords.resource:53
      Click    ${car_name}
      |  ${car_name} = [href="/config/summary/wrong"] (str)
______________________________________________________________________________
Configure Car with car Acc                                            | FAIL |
TimeoutError: page.click: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector "[href="/config/summary/wrong"]"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
01 CarConfig                                                          | FAIL |
3 tests, 0 passed, 3 failed
==============================================================================
Output:  /Source/RF-Schulung/02_RobotFiles/logs/output.xml
Log:     /Source/RF-Schulung/02_RobotFiles/logs/log.html
Report:  /Source/RF-Schulung/02_RobotFiles/logs/report.html

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分布

robotframework-stacktrace-0.4.1.tar.gz (12.6 kB 查看哈希值)

上传于 来源

构建分发

robotframework_stacktrace-0.4.1-py3-none-any.whl (8.5 kB 查看哈希值)

上传于 Python 3

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面