Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
titleExample usage
specRepo = gp.getAllSpecificationRepositories()[6];
sut = gp.getSystemUnderTestsOfProject('GREENPEPPERDEMO')[4];
doctree = gp.getSpecificationHierarchy(specRepo, sut);
 
# How do we visit this result ?
def visit(node):
    yield node[0],node[1]
    for child in node[3].values():
        for name, executable in visit(child):
            yield name, executable
 
i=0
for pageName, executable in visit(doctree):
    # I want only the executable ones
    if executable == True:
        i+=1
        print "[%s][%s] %s "% (i,executable,pageName)
Tip

On Confluence plugin, there is a simpler method :

Code Block
langagepy
languagepy
 doctree = gp.getSpecificationHierarchy('username','password',["SpaceKey"])

However, this method doesn't filter on an SUT nor for a Project. It's handy, if you have only one SUT and one Project for your Space.

String getRenderedSpecification(String username, String password, Vector<?> args)

...