生成测试用例的Robot Framework文档

时间:2018-07-05 20:47:09

标签: robotframework

是否可以为测试用例生成机器人框架文档?

我可以使用libdoc成功地为关键字和库生成文档,但是当我尝试对仅包含测试用例的.robot文件执行相同操作时,会出现以下错误。

测试用例文件:

*** Settings ***
Documentation   Suite documentation to appear on top of the html doc.
Resource        ../Root.robot

Suite Setup     Create Data
Suite Teardown  Delete Data
Test Setup      Go To Homepage
Test Teardown   Close All Browsers

*** Test Cases ***
Test A
    [Documentation]  The test case documentation.
    Do Something

在此文件上使用libdoc时出错:

Try --help for usage information.
[ ERROR ] Error in file '/<path>Test.robot': Non-existing setting 'Test Setup'.
[ ERROR ] Error in file '/<path>Test.robot': Non-existing setting 'Test Teardown'.
[ ERROR ] Error in file '/<path>Test.robot': Non-existing setting 'Suite Setup'.
[ ERROR ] Error in file '/<path>Test.robot': Non-existing setting 'Suite Teardown'.
Resource file '/<path>Test.robot' contains a test case table which is not allowed.

是因为libdoc不支持设置和拆卸吗?

1 个答案:

答案 0 :(得分:1)

对于测试用例文档,应使用TestDoc而不是LibDoc

这两个工具: http://robotframework.org/robotframework/#built-in-tools