catcher.core package¶
Submodules¶
catcher.core.runner module¶
catcher.core.test module¶
-
class
catcher.core.test.
Test
(path: str, file: str, includes: dict = None, variables: dict = None, config: dict = None, steps: list = None, final: list = None, ignore: Union[bool, str, dict] = None)[source]¶ Bases:
object
Testcase. Contains variables, includes, steps and final actions.
Ignore: if true will ignore this test. A condition based on catcher.steps.check.Check()
can be used to compute ignore condition dynamically.Include: other test to run. See catcher.core.include.Include()
. Can be a string in case of single include or a list of include in case of multiple. Each of them will be run before the test passing variables to each other and, finally, to the test. In case of run_on_include include’s property is false or as alias is set include won’t be run before the test. You can run such include viacatcher.steps.run.Run()
step later. See Includes for more info.Variables: test local variables which override inventory variables. These variables will be available only in this test or in test which includes this test. Variables itself can contain templates. See Variables for more info. Steps: A list of test actions which will be run one by one. They can use variables and support templates. Each step can register it’s output as a new variable. See catcher.steps.step.Step()
for available options. See internal_modules and external modules for more info.Finally: A list of clean up actions which will be run after test finishes execution. Condition for every clean up action run can be set (by default they run in any case). See How to write a test cheat sheet for more info and examples.
catcher.core.include module¶
-
class
catcher.core.include.
Include
(ignore_errors=False, file=None, **kwargs)[source]¶ Bases:
object
Include another testcase in include section:
- file: test file to include
- variables: variables to override
- alias: unique name to run this test later
- run_on_include: should run as soon as included (before test)
- ignore_errors: should continue running other tests if this fails
Examples: Simple include - will run before test
include: register_user.yaml
Will run before test with some variables overridden
include: file: register_user.yaml variables: user_email: 'override@email.org'
Multiple includes. Will run one by one. Variables from the first one will be passed to the next
include: - simple_form.yaml - file: long_form.yaml variables: {user_email: 'override@email.org'}
Include with alias and run later
include: file: register_user.yaml as: sign_up steps: # .... some steps - run: include: sign_up # .... some steps
See includes for more info.
catcher.core.step_factory module¶
members: |
|
---|