2017-11-23 10:44 GMT+02:00 Chinmaya Karve <
cka...@gmail.com>:
>
> Yeah; my objective is to get the numbers without having to run the suite. I had the testdoc tool, but it gives keyword information etc also, whereas, I was looking only for numbers per test suite. Are there any public test data parsing modules that you could suggest for this?
You can either use robot.api.TestData factory method to just parse the
data or robot.api.TestSuiteBuilder to also construct an executable
test suite based on the data. The latter is probably more useful as
it's easier to inspect the model it's produces using. You could try
something like this:
from robot.api import TestSuiteBuilder, SuiteVisitor
class PrintTestCounts(SuiteVisitor):
def start_suite(self, suite):
print('{}: {}'.format(
suite.name, len(suite.tests))
suite = TestSuiteBuilder().build('path/to/tests')
suite.visit(PrintTestCounts())
If you'd just be interested in the total number of tests, you could
just use `suite.test_count`. For more information about these APIs see
http://robot-framework.readthedocs.io/.
> Right now I am modifying the testdoc script to exclude keyword information from the output, and got initial success - can this be a switch in the tool in future?
Possibly. Depends on what it actually does.
Cheers,
.peke