robot.running.builder.builders
¶
TestSuiteBuilder
¶
|
Builder to construct TestSuite objects based on data on the disk.
The :meth:build method constructs executable
:class:~robot.running.model.TestSuite objects based on test data files
or directories. There are two main use cases for this API:
-
Execute the created suite by using its :meth:
~robot.running.model.TestSuite.runmethod. The suite can be modified before execution if needed. -
Inspect the suite to see, for example, what tests it has or what tags tests have. This can be more convenient than using the lower level :mod:
~robot.parsingAPIs.
Both modifying the suite and inspecting what data it contains are easiest
done by using the :mod:~robot.model.visitor interface.
This class is part of the public API and should be imported via the
:mod:robot.api package. An alternative is using the
:meth:TestSuite.from_file_system <robot.running.model.TestSuite.from_file_system>
classmethod that uses this class internally.
:param included_suites:
This argument used to be used for limiting what suite file to parse.
It is deprecated and has no effect starting from RF 6.1. Use the
new included_files argument or filter the created suite after
parsing instead.
:param included_extensions:
List of extensions of files to parse. Same as --extension.
:param included_files:
List of names, paths or directory paths of files to parse. All files
are parsed by default. Same as --parse-include. New in RF 6.1.
:param custom_parsers:
Custom parsers as names or paths (same as --parser) or as
parser objects. New in RF 6.1.
:param defaults:
Possible test specific defaults from suite initialization files.
New in RF 6.1.
:param rpa:
Explicit execution mode. True for RPA and False for test
automation. By default, mode is got from data file headers.
Same as --rpa or --norpa.
:param lang:
Additional languages to be supported during parsing.
Can be a string matching any of the supported language codes or names,
an initialized :class:~robot.conf.languages.Language subclass,
a list containing such strings or instances, or a
:class:~robot.conf.languages.Languages instance.
:param allow_empty_suite:
Specify is it an error if the built suite contains no tests.
Same as --runemptysuite.
:param process_curdir:
Control processing the special ${CURDIR} variable. It is
resolved already at parsing time by default, but that can be
changed by giving this argument False value.
Source code in src/robot/running/builder/builders.py
build
¶
:param paths: Paths to test data files or directories.
:return: :class:~robot.running.model.TestSuite instance.