0
votes

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:

  • Setting 'Test Setup' is not allowed in resource file.
  • Setting 'Test Teardown' is not allowed in resource file.
  • Resource file with 'Test Cases' section is invalid.

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

1
The correct term is suite files and not "test case". What did the libdoc documentation say?Bence Kaulics
as I mention the following errors are present during the using of libdoc to document a suite file: Setting 'Test Setup' is not allowed in resource file. Setting 'Test Teardown' is not allowed in resource file. Resource file with 'Test Cases' section is invalid. my question is : How can I documente the keywords defined inside a suite file ?Lajuve

1 Answers

0
votes

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