|
| def | __init__ (self, name='', doc='', metadata=None, source=None, rpa=None) |
| |
| def | configure (self, randomize_suites=False, randomize_tests=False, randomize_seed=None, **options) |
| | A shortcut to configure a suite using one method call. More...
|
| |
| def | from_file_system (cls, *paths, **config) |
| | Create a :class:TestSuite object based on the given paths. More...
|
| |
| def | from_model (cls, model, name=None) |
| | Create a :class:TestSuite object based on the given model. More...
|
| |
| def | randomize (self, suites=True, tests=True, seed=None) |
| | Randomizes the order of suites and/or tests, recursively. More...
|
| |
| def | run (self, settings=None, **options) |
| | Executes the suite based based the given settings or options. More...
|
| |
| def | __init__ (self, name='', doc='', metadata=None, source=None, rpa=False, parent=None) |
| |
| def | __str__ (self) |
| |
| def | configure (self, **options) |
| | A shortcut to configure a suite using one method call. More...
|
| |
| def | filter (self, included_suites=None, included_tests=None, included_tags=None, excluded_tags=None) |
| | Select test cases and remove others from this suite. More...
|
| |
| def | metadata (self, metadata) |
| | Free test suite metadata as a dictionary. More...
|
| |
| def | remove_empty_suites (self, preserve_direct_children=False) |
| | Removes all child suites not containing any tests, recursively. More...
|
| |
| def | set_tags (self, add=None, remove=None, persist=False) |
| | Add and/or remove specified tags to the tests in this suite. More...
|
| |
| def | suites (self, suites) |
| | Child suites as a :class:~.TestSuites object. More...
|
| |
| def | tests (self, tests) |
| | Tests as a :class:~.TestCases object. More...
|
| |
| def | visit (self, visitor) |
| | :mod:Visitor interface <robot.model.visitor> entry-point. More...
|
| |
| def | __repr__ (self) |
| |
| def | config (self, **attributes) |
| | Configure model object with given attributes. More...
|
| |
| def | copy (self, **attributes) |
| | Return shallow copy of this object. More...
|
| |
| def | deepcopy (self, **attributes) |
| | Return deep copy of this object. More...
|
| |
Represents a single executable test suite.
See the base class for documentation of attributes not documented here.
Definition at line 292 of file model.py.
| def robot.running.model.TestSuite.configure |
( |
|
self, |
|
|
|
randomize_suites = False, |
|
|
|
randomize_tests = False, |
|
|
|
randomize_seed = None, |
|
|
** |
options |
|
) |
| |
A shortcut to configure a suite using one method call.
Can only be used with the root test suite.
:param randomize_xxx: Passed to :meth:`randomize`.
:param options: Passed to
:class:`~robot.model.configurer.SuiteConfigurer` that will then
set suite attributes, call :meth:`filter`, etc. as needed.
Example::
suite.configure(included_tags=['smoke'],
doc='Smoke test results.')
Not to be confused with :meth:`config` method that suites, tests,
and keywords have to make it possible to set multiple attributes in
one call.
Definition at line 349 of file model.py.
| def robot.running.model.TestSuite.randomize |
( |
|
self, |
|
|
|
suites = True, |
|
|
|
tests = True, |
|
|
|
seed = None |
|
) |
| |
Randomizes the order of suites and/or tests, recursively.
:param suites: Boolean controlling should suites be randomized.
:param tests: Boolean controlling should tests be randomized.
:param seed: Random seed. Can be given if previous random order needs
to be re-created. Seed value is always shown in logs and reports.
Definition at line 361 of file model.py.
| def robot.running.model.TestSuite.run |
( |
|
self, |
|
|
|
settings = None, |
|
|
** |
options |
|
) |
| |
Executes the suite based based the given settings or options.
:param settings: :class:`~robot.conf.settings.RobotSettings` object
to configure test execution.
:param options: Used to construct new
:class:`~robot.conf.settings.RobotSettings` object if ``settings``
are not given.
:return: :class:`~robot.result.executionresult.Result` object with
information about executed suites and tests.
If ``options`` are used, their names are the same as long command line
options except without hyphens. Some options are ignored (see below),
but otherwise they have the same semantics as on the command line.
Options that can be given on the command line multiple times can be
passed as lists like ``variable=['VAR1:value1', 'VAR2:value2']``.
If such an option is used only once, it can be given also as a single
string like ``variable='VAR:value'``.
Additionally listener option allows passing object directly instead of
listener name, e.g. ``run('tests.robot', listener=Listener())``.
To capture stdout and/or stderr streams, pass open file objects in as
special keyword arguments ``stdout`` and ``stderr``, respectively.
Only options related to the actual test execution have an effect.
For example, options related to selecting or modifying test cases or
suites (e.g. ``--include``, ``--name``, ``--prerunmodifier``) or
creating logs and reports are silently ignored. The output XML
generated as part of the execution can be configured, though. This
includes disabling it with ``output=None``.
Example::
stdout = StringIO()
result = suite.run(variable='EXAMPLE:value',
output='example.xml',
exitonfailure=True,
stdout=stdout)
print(result.return_code)
To save memory, the returned
:class:`~robot.result.executionresult.Result` object does not
have any information about the executed keywords. If that information
is needed, the created output XML file needs to be read using the
:class:`~robot.result.resultbuilder.ExecutionResult` factory method.
See the :mod:`package level <robot.running>` documentation for
more examples, including how to construct executable test suites and
how to create logs and reports based on the execution results.
See the :func:`robot.run <robot.run.run>` function for a higher-level
API for executing tests in files or directories.
Definition at line 417 of file model.py.