18 from .configurer
import SuiteConfigurer
19 from .filter
import Filter, EmptySuiteRemover
20 from .fixture
import create_fixture
21 from .itemlist
import ItemList
22 from .keyword
import Keyword, Keywords
23 from .metadata
import Metadata
24 from .modelobject
import ModelObject
25 from .tagsetter
import TagSetter
26 from .testcase
import TestCase, TestCases
36 fixture_class = Keyword
38 __slots__ = [
'parent',
'source',
'_name',
'doc',
'_setup',
'_teardown',
'rpa',
41 def __init__(self, name='', doc='', metadata=None, source=None, rpa=False,
59 parent_visitors = self.
parentparent._visitors
if self.
parentparent
else []
72 self.
_name_name = name
91 return TestSuites(self.__class__, self, suites)
125 if self.
_setup_setup
is None and self:
149 return bool(self.
_setup_setup)
159 if self.
_teardown_teardown
is None and self:
175 has_teardown = property
189 return Keywords(self, [kw
for kw
in keywords
if kw])
194 Keywords.raise_deprecation_error()
212 return '%s-s%d' % (self.
parentparent.id, self.
parentparent.suites.index(self)+1)
216 test_count = property
227 return any(s.has_tests
for s
in self.
suitessuitessuites)
238 def set_tags(self, add=None, remove=None, persist=False):
240 self.
visitvisit(setter)
259 def filter(self, included_suites=None, included_tests=None,
260 included_tags=None, excluded_tags=None):
261 self.
visitvisit(
Filter(included_suites, included_tests,
262 included_tags, excluded_tags))
277 if self.
parentparent
is not None:
278 raise ValueError(
"'TestSuite.configure()' can only be used with "
279 "the root test suite.")
289 visitor.visit_suite(self)
298 def __init__(self, suite_class=TestSuite, parent=None, suites=None):
299 ItemList.__init__(self, suite_class, {
'parent': parent}, suites)
A list-like object representing keywords in a suite, a test or a keyword.
Base model for single suite.
teardown
Suite teardown as a :class:~.model.keyword.Keyword object.
has_setup
Check does a suite have a setup without creating a setup object.
def suites(self, suites)
Child suites as a :class:~.TestSuites object.
def remove_empty_suites(self, preserve_direct_children=False)
Removes all child suites not containing any tests, recursively.
id
An automatically generated unique id.
keywords
Deprecated since Robot Framework 4.0.
test_count
Number of the tests in this suite, recursively.
def metadata(self, metadata)
Free test suite metadata as a dictionary.
def visit(self, visitor)
:mod:Visitor interface <robot.model.visitor> entry-point.
def set_tags(self, add=None, remove=None, persist=False)
Add and/or remove specified tags to the tests in this suite.
def tests(self, tests)
Tests as a :class:~.TestCases object.
def teardown(self, teardown)
setup
Suite setup as a :class:~.model.keyword.Keyword object.
def configure(self, **options)
A shortcut to configure a suite using one method call.
def filter(self, included_suites=None, included_tests=None, included_tags=None, excluded_tags=None)
Select test cases and remove others from this suite.
def __init__(self, name='', doc='', metadata=None, source=None, rpa=False, parent=None)
has_teardown
Check does a suite have a teardown without creating a teardown object.
longname
Suite name prefixed with the long name of the parent suite.
def __init__(self, suite_class=TestSuite, parent=None, suites=None)
def create_fixture(fixture, parent, type)