Base model for a single test case. More...
Public Member Functions | |
| def | __init__ (self, name='', doc='', tags=None, timeout=None, lineno=None, parent=None) |
| def | __str__ (self) |
| def | body (self, body) |
Test body as a :class:~robot.model.body.Body object. More... | |
| def | tags (self, tags) |
Test tags as a :class:~.model.tags.Tags 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 | |
| body | |
| doc | |
| lineno | |
| name | |
| parent | |
| tags | |
| timeout | |
Static Public Attributes | |
| body_class = Body | |
| fixture_class = Keyword | |
| tuple | repr_args = ('name',) |
Static Public Attributes inherited from robot.model.modelobject.ModelObject | |
| tuple | repr_args = () |
Properties | |
| has_setup = property | |
| Check does a suite have a setup without creating a setup object. More... | |
| has_teardown = property | |
| Check does a test have a teardown without creating a teardown object. More... | |
| id = property | |
Test case id in format like s1-t3. More... | |
| keywords = property | |
| Deprecated since Robot Framework 4.0. More... | |
| longname = property | |
| Test name prefixed with the long name of the parent suite. More... | |
| setup = property | |
Test setup as a :class:~.model.keyword.Keyword object. More... | |
| source = property | |
| teardown = property | |
Test teardown as a :class:~.model.keyword.Keyword object. More... | |
Private Member Functions | |
| def | has_setup (self) |
| def | has_teardown (self) |
| def | id (self) |
| def | keywords (self) |
| def | keywords (self, keywords) |
| def | longname (self) |
| def | setup (self) |
| def | setup (self, setup) |
| def | source (self) |
| def | teardown (self) |
| def | teardown (self, teardown) |
Private Attributes | |
| _setup | |
| _teardown | |
Static Private Attributes | |
| list | __slots__ = ['parent', 'name', 'doc', 'timeout', 'lineno', '_setup', '_teardown'] |
Base model for a single test case.
Extended by :class:`robot.running.model.TestCase` and :class:`robot.result.model.TestCase`.
Definition at line 31 of file testcase.py.
| def robot.model.testcase.TestCase.__init__ | ( | self, | |
name = '', |
|||
doc = '', |
|||
tags = None, |
|||
timeout = None, |
|||
lineno = None, |
|||
parent = None |
|||
| ) |
Reimplemented in robot.running.model.TestCase.
Definition at line 37 of file testcase.py.
| def robot.model.testcase.TestCase.__str__ | ( | self | ) |
Definition at line 188 of file testcase.py.
| def robot.model.testcase.TestCase.body | ( | self, | |
| body | |||
| ) |
Test body as a :class:~robot.model.body.Body object.
Definition at line 51 of file testcase.py.
|
private |
Definition at line 108 of file testcase.py.
|
private |
Definition at line 137 of file testcase.py.
|
private |
Definition at line 164 of file testcase.py.
|
private |
Definition at line 147 of file testcase.py.
|
private |
Definition at line 153 of file testcase.py.
|
private |
Definition at line 173 of file testcase.py.
|
private |
Definition at line 85 of file testcase.py.
|
private |
Definition at line 92 of file testcase.py.
|
private |
Reimplemented in robot.running.model.TestCase.
Definition at line 181 of file testcase.py.
| def robot.model.testcase.TestCase.tags | ( | self, | |
| tags | |||
| ) |
Test tags as a :class:~.model.tags.Tags object.
Definition at line 56 of file testcase.py.
|
private |
Definition at line 118 of file testcase.py.
|
private |
Definition at line 125 of file testcase.py.
| def robot.model.testcase.TestCase.visit | ( | self, | |
| visitor | |||
| ) |
:mod:Visitor interface <robot.model.visitor> entry-point.
Definition at line 185 of file testcase.py.
|
staticprivate |
Definition at line 35 of file testcase.py.
|
private |
Definition at line 46 of file testcase.py.
|
private |
Definition at line 47 of file testcase.py.
| robot.model.testcase.TestCase.body |
Definition at line 45 of file testcase.py.
|
static |
Definition at line 32 of file testcase.py.
| robot.model.testcase.TestCase.doc |
Definition at line 40 of file testcase.py.
|
static |
Definition at line 33 of file testcase.py.
| robot.model.testcase.TestCase.lineno |
Definition at line 43 of file testcase.py.
| robot.model.testcase.TestCase.name |
Definition at line 39 of file testcase.py.
| robot.model.testcase.TestCase.parent |
Definition at line 44 of file testcase.py.
|
static |
Definition at line 34 of file testcase.py.
| robot.model.testcase.TestCase.tags |
Definition at line 41 of file testcase.py.
| robot.model.testcase.TestCase.timeout |
Definition at line 42 of file testcase.py.
|
static |
Check does a suite have a setup without creating a setup object.
A difference between using ``if test.has_setup:`` and ``if test.setup:``
is that accessing the :attr:`setup` attribute creates a :class:`Keyword`
object representing the setup even when the test actually does not have
one. This typically does not matter, but with bigger suite structures
containing a huge about of tests it can have an effect on memory usage.
New in Robot Framework 5.0.
Definition at line 106 of file testcase.py.
|
static |
Check does a test have a teardown without creating a teardown object.
See :attr:`has_setup` for more information.
New in Robot Framework 5.0.
Definition at line 135 of file testcase.py.
|
static |
Test case id in format like s1-t3.
See :attr:`TestSuite.id <robot.model.testsuite.TestSuite.id>` for
more information.
Definition at line 162 of file testcase.py.
|
static |
Deprecated since Robot Framework 4.0.
Use :attr:`body`, :attr:`setup` or :attr:`teardown` instead.
Definition at line 145 of file testcase.py.
|
static |
Test name prefixed with the long name of the parent suite.
Definition at line 171 of file testcase.py.
|
static |
Test setup as a :class:~.model.keyword.Keyword object.
This attribute is a ``Keyword`` object also when a test has no setup
but in that case its truth value is ``False``.
Setup can be modified by setting attributes directly::
test.setup.name = 'Example'
test.setup.args = ('First', 'Second')
Alternatively the :meth:`config` method can be used to set multiple
attributes in one call::
test.setup.config(name='Example', args=('First', 'Second'))
The easiest way to reset the whole setup is setting it to ``None``.
It will automatically recreate the underlying ``Keyword`` object::
test.setup = None
New in Robot Framework 4.0. Earlier setup was accessed like
``test.keywords.setup``.
Definition at line 83 of file testcase.py.
|
static |
Definition at line 179 of file testcase.py.
|
static |
Test teardown as a :class:~.model.keyword.Keyword object.
See :attr:`setup` for more information.
Definition at line 116 of file testcase.py.