robotframework - 使用 "Test Template"(数据驱动)时每个测试用例的文档

标签 robotframework data-driven-tests

使用“测试模板”时,如何为生成的测试用例设置[文档]?

我有一个解决方法:

*** Settings ***
Test Template    The Test Logic

*** Test Cases ***    arg1   arg2   documentation
Test Case 1            1      a     Doc of test 1
Test Case 2            2      b     Doc of test 2
Test Case 3            3      c     Doc of test 3


*** Keywords ***
The Test Logic
    [Arguments]        ${arg1}     ${arg2}    ${documentation}
    Set Test Documentation      ${documentation}
    Log Many           ${arg1}      ${arg2}

但我认为应该有一种更原生的方式。 我找不到这样的方法。有谁知道吗?

最佳答案

我认为最好的解决方案就是这样。

*** Settings ***
Test Template    The Test Logic

*** Test Cases ***    arg1   arg2
Test Case 1            1      a
Test Case 2            2      b
Test Case 3            3      c


*** Keywords ***
The Test Logic
    [Arguments]        ${arg1}     ${arg2}
    Set Test Documentation      Test case covering scenario of ${arg1} and ${arg2}
    Log Many           ${arg1}      ${arg2}

关于robotframework - 使用 "Test Template"(数据驱动)时每个测试用例的文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59966636/

相关文章:

java - RobotFramework无法导入Java关键字库

python - 运行包含超过一百万个测试用例的测试套件

csv - CodedUI 测试不从 CSV 输入文件读取数据

ios - 如何在 Xcode 中执行数据驱动测试

python - 在 Robot Framework 中禁用 "DevTools listening on ws://127.0.0.1..."日志消息

python - 如何从JSON字符串中获取所需的内容

python - 如何自定义机器人框架测试报告

excel - 一个Excel工作簿中可以创建多少个工作表用于自动化测试?

c# - 扩展 Microsoft.VisualStudio.TestTools.DataSource.XML

c# - MSTest - 可以在 TestInitialize 和 TestCleanup 中访问 [DataRow] 值吗?