rfhub2
rfhub2 copied to clipboard
Feature: Support for test_cases as well?
trafficstars
Libdoc does keywords Testdoc does testcases
What would the effort be to add testcase documentation to the tooling?
Hi @james-powis, it would require few things:
- extending UI, obviously
- adding new endpoints for tests
- adding new table for tests
- adding test importer client to cli
I have just once used testdoc tool, but I think that nesting tests may be important here. Flattening test cases might end up in fogging overall view.
I think adding the tests into the view would be a killer feature. I hope we get this!
Frontend changes:
- Since LibDoc has a different output structure than TestDoc, a change on UI is inevitable. Robot is producing nested output using structure like this:
s1-s2-s3-t14where s stands for suite and t for test. Using this approach would be most simple one. Using Material UI card-collection seems like a way to go. Each card would hold data such as number of test cases, suite documentation, suite tags, setup, teardown and path to suite. Clicking each card would allow drill down into next suites, up to test level, with same info as above. - switching from libraries/keywords view in app bar to keywords and testcases. In future executions and dashboard could be added there.
- Search endpoint on frontend should be related to current page chosen from app bar - if in testcases it should scan testcases, if in keywords it should scan keywords.
Backend changes:
- New models, such as Suite and Testcase. Parameters I can think of now:
id, level (ie. s1-s2-t14), name, doc, tags, testcase number, setup, teardown, path. Relation woould be similar to Collection and nested Keywords with Suites and Testcases. - endpoints for suites, should return general suite information, as well as aggregated data for lower suites, such as testcase number.
- data from suite/testcase endpoints should be ready for filtering by name or by object level (ie
s2-s1-t14)
CLI changes:
- adding new module for testcase extractor, that is populating application. Utilising Robot Framework's TestSuiteFactory is the way to go:
from robot.testdoc import TestSuiteFactory
from pathlib import Path
dir = Path.cwd() / ".." / ".." / "tests" / "acceptance"
suite = TestSuiteFactory(str(dir)).suites
@pbylicki what do You think?