Can I run Setup, Test and Teardown separately?

You need to use v3 listeners for this. In the end_test method you ought to be able to use something like this to create a new test:

new = test.parent.tests.create(name='New test')
new.body.create_keyword(name='Log', args=['Example'])

Or something like this to copy an existing test:

copy = test.copy(name='New name')
test.parent.tests.append(copy)

Same stuff works also with modifiers. You are working with same model objects in both cases.

1 Like