Lajuve
Lajuve

Reputation: 1

Robotframework - How to document keywords present inside a tests

i am stucking on a documentation topic for some robot test cases.

Context: I try to generate the documentation for all robot files (test cases or keywords libraries). About the keywords library => robot.libdoc does the job as expected. About the tests cases => robot.testdoc does the job as expected.

However for the following situation i have no idea. e.g:

*** Settings ***
Documentation     description of test case: bla bla bla
Test Setup        SETUP_TC_001
Test Teardown     TEARDOWN_TC_001
Ressource         r1
Ressource         r2

*** Test Cases ***
TC_001
   step1
   step2

*** Keywords ***
SET_UP_TC_001
     Action1
     Action2

TEARDOWN_TC_001
    TD_action1
    TD_action2

Question: How can we generate the documentation for keywords which are defined inside the test case ? I try with libdoc and the following errors are present:

I try the same with testdoc, which describe the test case and the steps order but the internal keywords. Do i miss something ?

Br Lajuve

Upvotes: 0

Views: 1577

Answers (1)

Isaac Pindado
Isaac Pindado

Reputation: 93

libdoc is the tool for "keyword" resources documentation generation. In order to generate the documentation of the tests, you should use testdoc tool.

python -m robot.testdoc ./robot/space-test-plan.robot space-test-plan.html

This should generate an HTML report of the TestCase, and if you have a keyword resource file associated, you can generate this documentation with the libdoc tool

python -m robot.testdoc  ./robot/resources.robot resources.html

Upvotes: 0

Related Questions