Robot Framework
robot.running.builder.builders.TestSuiteBuilder Class Reference

Builder to construct TestSuite objects based on data on the disk. More...

Public Member Functions

def __init__ (self, included_suites=None, included_extensions=('robot',), rpa=None, lang=None, allow_empty_suite=False, process_curdir=True)
 :param include_suites: List of suite names to include. More...
 
def build (self, *paths)
 :param paths: Paths to test data files or directories. More...
 

Public Attributes

 allow_empty_suite
 
 included_extensions
 
 included_suites
 
 lang
 
 process_curdir
 
 rpa
 

Private Member Functions

def _validate_test_counts (self, suite, multisource=False)
 

Detailed Description

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.run` method. 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.parsing` APIs but does not allow saving modified data
  back to the disk.

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.

Definition at line 47 of file builders.py.

Constructor & Destructor Documentation

◆ __init__()

def robot.running.builder.builders.TestSuiteBuilder.__init__ (   self,
  included_suites = None,
  included_extensions = ('robot',),
  rpa = None,
  lang = None,
  allow_empty_suite = False,
  process_curdir = True 
)

:param include_suites: List of suite names to include.

If None or an empty list, all suites are included. Same as using --suite on the command line. :param included_extensions: List of extensions of files to parse. Same as --extension. :param rpa: Explicit test execution mode. True for RPA and False for test automation. By default, mode is got from data file headers and possible conflicting headers cause an error. 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 subsclass, 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.

Definition at line 72 of file builders.py.

Member Function Documentation

◆ _validate_test_counts()

def robot.running.builder.builders.TestSuiteBuilder._validate_test_counts (   self,
  suite,
  multisource = False 
)
private

Definition at line 97 of file builders.py.

◆ build()

def robot.running.builder.builders.TestSuiteBuilder.build (   self,
paths 
)

:param paths: Paths to test data files or directories.

:return: :class:~robot.running.model.TestSuite instance.

Definition at line 86 of file builders.py.

Member Data Documentation

◆ allow_empty_suite

robot.running.builder.builders.TestSuiteBuilder.allow_empty_suite

Definition at line 79 of file builders.py.

◆ included_extensions

robot.running.builder.builders.TestSuiteBuilder.included_extensions

Definition at line 78 of file builders.py.

◆ included_suites

robot.running.builder.builders.TestSuiteBuilder.included_suites

Definition at line 77 of file builders.py.

◆ lang

robot.running.builder.builders.TestSuiteBuilder.lang

Definition at line 76 of file builders.py.

◆ process_curdir

robot.running.builder.builders.TestSuiteBuilder.process_curdir

Definition at line 80 of file builders.py.

◆ rpa

robot.running.builder.builders.TestSuiteBuilder.rpa

Definition at line 75 of file builders.py.


The documentation for this class was generated from the following file: