Robot Framework
robot.result.model.TestSuite Class Reference

Represents results of a single test suite. More...

Inheritance diagram for robot.result.model.TestSuite:
robot.model.testsuite.TestSuite robot.result.model.StatusMixin robot.model.modelobject.ModelObject metaclass

Public Member Functions

def __init__ (self, name='', doc='', metadata=None, source=None, message='', starttime=None, endtime=None, rpa=False, parent=None)
 
def configure (self, **options)
 A shortcut to configure a suite using one method call. More...
 
def filter_messages (self, log_level='TRACE')
 Remove log messages below the specified log_level. More...
 
def handle_suite_teardown_failures (self)
 Internal usage only. More...
 
def remove_keywords (self, how)
 Remove keywords based on the given condition. More...
 
def suite_teardown_failed (self, error)
 Internal usage only. More...
 
def suite_teardown_skipped (self, message)
 Internal usage only. More...
 
- Public Member Functions inherited from robot.model.testsuite.TestSuite
def __init__ (self, name='', doc='', metadata=None, source=None, rpa=False, parent=None)
 
def __str__ (self)
 
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...
 
- Public Member Functions inherited from robot.model.modelobject.ModelObject
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...
 

Public Attributes

 endtime
 
 message
 
 starttime
 
- Public Attributes inherited from robot.model.testsuite.TestSuite
 doc
 
 metadata
 
 parent
 
 rpa
 
 source
 
 suites
 
 tests
 
- Public Attributes inherited from robot.result.model.StatusMixin
 status
 

Static Public Attributes

 fixture_class = Keyword
 
 test_class = TestCase
 
- Static Public Attributes inherited from robot.model.testsuite.TestSuite
 fixture_class = Keyword
 
tuple repr_args = ('name',)
 
 test_class = TestCase
 
- Static Public Attributes inherited from robot.model.modelobject.ModelObject
tuple repr_args = ()
 
- Static Public Attributes inherited from robot.result.model.StatusMixin
string FAIL = 'FAIL'
 
string NOT_RUN = 'NOT RUN'
 
string NOT_SET = 'NOT SET'
 
string PASS = 'PASS'
 
string SKIP = 'SKIP'
 

Properties

 elapsedtime = property
 Total execution time in milliseconds. More...
 
 failed = property
 True if any test has failed, False otherwise. More...
 
 full_message = property
 Combination of :attr:message and :attr:stat_message. More...
 
 not_run = property
 
 passed = property
 True if no test has failed but some have passed, False otherwise. More...
 
 skipped = property
 True if there are no passed or failed tests, False otherwise. More...
 
 stat_message = property
 String representation of the :attr:statistics. More...
 
 statistics = property
 Suite statistics as a :class:~robot.model.totalstatistics.TotalStatistics object. More...
 
 status = property
 'PASS', 'FAIL' or 'SKIP' depending on test statuses. More...
 
- Properties inherited from robot.model.testsuite.TestSuite
 _visitors = property
 
 has_setup = property
 Check does a suite have a setup without creating a setup object. More...
 
 has_teardown = property
 Check does a suite have a teardown without creating a teardown object. More...
 
 has_tests = property
 
 id = property
 An automatically generated unique id. More...
 
 keywords = property
 Deprecated since Robot Framework 4.0. More...
 
 longname = property
 Suite name prefixed with the long name of the parent suite. More...
 
 name = property
 Test suite name. More...
 
 setup = property
 Suite setup as a :class:~.model.keyword.Keyword object. More...
 
 teardown = property
 Suite teardown as a :class:~.model.keyword.Keyword object. More...
 
 test_count = property
 Number of the tests in this suite, recursively. More...
 
- Properties inherited from robot.result.model.StatusMixin
 elapsedtime = property
 Total execution time in milliseconds. More...
 
 failed = property
 True when :attr:status is 'FAIL', False otherwise. More...
 
 not_run = property
 True when :attr:status is 'NOT RUN', False otherwise. More...
 
 passed = property
 True when :attr:status is 'PASS', False otherwise. More...
 
 skipped = property
 True when :attr:status is 'SKIP', False otherwise. More...
 

Private Member Functions

def elapsedtime (self)
 
def failed (self)
 
def full_message (self)
 
def not_run (self)
 
def passed (self)
 
def skipped (self)
 
def stat_message (self)
 
def statistics (self)
 
def status (self)
 

Static Private Attributes

list __slots__ = ['message', 'starttime', 'endtime']
 

Detailed Description

Represents results of a single test suite.

See the base class for documentation of attributes not documented here.

Definition at line 602 of file model.py.

Constructor & Destructor Documentation

◆ __init__()

def robot.result.model.TestSuite.__init__ (   self,
  name = '',
  doc = '',
  metadata = None,
  source = None,
  message = '',
  starttime = None,
  endtime = None,
  rpa = False,
  parent = None 
)

Definition at line 607 of file model.py.

Member Function Documentation

◆ configure()

def robot.result.model.TestSuite.configure (   self,
**  options 
)

A shortcut to configure a suite using one method call.

    Can only be used with the root test suite.

    :param options: Passed to
        :class:`~robot.result.configurer.SuiteConfigurer` that will then
        set suite attributes, call :meth:`filter`, etc. as needed.

    Example::

        suite.configure(remove_keywords='PASSED',
                        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.

Reimplemented from robot.model.testsuite.TestSuite.

Definition at line 736 of file model.py.

◆ elapsedtime()

def robot.result.model.TestSuite.elapsedtime (   self)
private

Reimplemented from robot.result.model.StatusMixin.

Definition at line 698 of file model.py.

◆ failed()

def robot.result.model.TestSuite.failed (   self)
private

Reimplemented from robot.result.model.StatusMixin.

Definition at line 628 of file model.py.

◆ filter_messages()

def robot.result.model.TestSuite.filter_messages (   self,
  log_level = 'TRACE' 
)

Remove log messages below the specified log_level.

Definition at line 716 of file model.py.

◆ full_message()

def robot.result.model.TestSuite.full_message (   self)
private

Definition at line 682 of file model.py.

◆ handle_suite_teardown_failures()

def robot.result.model.TestSuite.handle_suite_teardown_failures (   self)

Internal usage only.

Definition at line 741 of file model.py.

◆ not_run()

def robot.result.model.TestSuite.not_run (   self)
private

Reimplemented from robot.result.model.StatusMixin.

Definition at line 641 of file model.py.

◆ passed()

def robot.result.model.TestSuite.passed (   self)
private

Reimplemented from robot.result.model.StatusMixin.

Definition at line 621 of file model.py.

◆ remove_keywords()

def robot.result.model.TestSuite.remove_keywords (   self,
  how 
)

Remove keywords based on the given condition.

    :param how: What approach to use when removing keywords. Either
        ``ALL``, ``PASSED``, ``FOR``, ``WUKS``, or ``NAME:<pattern>``.

    For more information about the possible values see the documentation
    of the ``--removekeywords`` command line option.

Definition at line 712 of file model.py.

◆ skipped()

def robot.result.model.TestSuite.skipped (   self)
private

Reimplemented from robot.result.model.StatusMixin.

Definition at line 635 of file model.py.

◆ stat_message()

def robot.result.model.TestSuite.stat_message (   self)
private

Definition at line 691 of file model.py.

◆ statistics()

def robot.result.model.TestSuite.statistics (   self)
private

Definition at line 675 of file model.py.

◆ status()

def robot.result.model.TestSuite.status (   self)
private

Definition at line 654 of file model.py.

◆ suite_teardown_failed()

def robot.result.model.TestSuite.suite_teardown_failed (   self,
  error 
)

Internal usage only.

Definition at line 745 of file model.py.

◆ suite_teardown_skipped()

def robot.result.model.TestSuite.suite_teardown_skipped (   self,
  message 
)

Internal usage only.

Definition at line 749 of file model.py.

Member Data Documentation

◆ __slots__

list robot.result.model.TestSuite.__slots__ = ['message', 'starttime', 'endtime']
staticprivate

Definition at line 603 of file model.py.

◆ endtime

robot.result.model.TestSuite.endtime

Definition at line 615 of file model.py.

◆ fixture_class

robot.result.model.TestSuite.fixture_class = Keyword
static

Definition at line 605 of file model.py.

◆ message

robot.result.model.TestSuite.message

Definition at line 611 of file model.py.

◆ starttime

robot.result.model.TestSuite.starttime

Definition at line 613 of file model.py.

◆ test_class

robot.result.model.TestSuite.test_class = TestCase
static

Definition at line 604 of file model.py.

Property Documentation

◆ elapsedtime

robot.result.model.TestSuite.elapsedtime = property
static

Total execution time in milliseconds.

Definition at line 696 of file model.py.

◆ failed

robot.result.model.TestSuite.failed = property
static

True if any test has failed, False otherwise.

Definition at line 626 of file model.py.

◆ full_message

robot.result.model.TestSuite.full_message = property
static

Combination of :attr:message and :attr:stat_message.

Definition at line 680 of file model.py.

◆ not_run

robot.result.model.TestSuite.not_run = property
static

Definition at line 639 of file model.py.

◆ passed

robot.result.model.TestSuite.passed = property
static

True if no test has failed but some have passed, False otherwise.

Definition at line 619 of file model.py.

◆ skipped

robot.result.model.TestSuite.skipped = property
static

True if there are no passed or failed tests, False otherwise.

Definition at line 633 of file model.py.

◆ stat_message

robot.result.model.TestSuite.stat_message = property
static

String representation of the :attr:statistics.

Definition at line 689 of file model.py.

◆ statistics

robot.result.model.TestSuite.statistics = property
static

Suite statistics as a :class:~robot.model.totalstatistics.TotalStatistics object.

    Recreated every time this property is accessed, so saving the results
    to a variable and inspecting it is often a good idea::

        stats = suite.statistics
        print(stats.failed)
        print(stats.total)
        print(stats.message)

Definition at line 673 of file model.py.

◆ status

robot.result.model.TestSuite.status = property
static

'PASS', 'FAIL' or 'SKIP' depending on test statuses.

    - If any test has failed, status is 'FAIL'.
    - If no test has failed but at least some test has passed, status is 'PASS'.
    - If there are no failed or passed tests, status is 'SKIP'. This covers both
      the case when all tests have been skipped and when there are no tests.

Definition at line 652 of file model.py.


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