avocado_robot package

Submodules

avocado_robot.runner module

Avocado nrunner for Robot Framework tests

class avocado_robot.runner.RobotRunner(runnable)

Bases: avocado.core.nrunner.BaseRunner

run()

Runner main method

Yields dictionary as output, containing status as well as relevant information concerning the results.

class avocado_robot.runner.RunnerApp(echo=<built-in function print>, prog=None, description=None)

Bases: avocado.core.nrunner.BaseRunnerApp

PROG_DESCRIPTION = '*nrunner application for robot tests'

The description of the command line application given to the command line parser

PROG_NAME = 'avocado-runner-robot'

The name of the command line application given to the command line parser

RUNNABLE_KINDS_CAPABLE = {'robot': <class 'avocado_robot.runner.RobotRunner'>}

The types of runnables that this runner can handle. Dictionary key is a name, and value is a class that inherits from BaseRunner

avocado_robot.runner.main()

Module contents

Plugin to run Robot Framework tests in Avocado

class avocado_robot.NotRobotTest

Bases: object

Not a robot test (for reporting purposes)

class avocado_robot.RobotCLI

Bases: avocado.core.plugin_interfaces.CLI

Run Robot Framework tests

configure(parser)

Configures the command line parser with options specific to this plugin.

description = "Robot Framework options for 'run' subcommand"
name = 'robot'
run(config)

Execute any action the plugin intends.

Example of action may include activating a special features upon finding that the requested command line options were set by the user.

Note: this plugin class is not intended for adding new commands, for that please use CLICmd.

class avocado_robot.RobotLoader(config, extra_params)

Bases: avocado.core.loader.TestLoader

Robot loader class

discover(reference, which_tests=DiscoverMode.DEFAULT)

Discover (possible) tests from an reference.

Parameters
  • reference (str) – the reference to be inspected.

  • which_tests (DiscoverMode) – Limit tests to be displayed

Returns

a list of test matching the reference as params.

static get_decorator_mapping()

Get label mapping for display in test listing.

Returns

Dict {TestClass: decorator function}

static get_type_label_mapping()

Get label mapping for display in test listing.

Returns

Dict {TestClass: ‘TEST_LABEL_STRING’}

name = 'robot'
class avocado_robot.RobotResolver(config=None)

Bases: avocado.core.plugin_interfaces.Resolver

description = 'Test resolver for Robot Framework tests'
name = 'robot'
static resolve(reference)

Resolves the given reference into a reference resolution.

Parameters

reference (str) – a specification that can eventually be resolved into a test (in the form of a avocado.core.nrunner.Runnable)

Returns

the result of the resolution process, containing the success, failure or error, along with zero or more avocado.core.nrunner.Runnable objects

Return type

avocado.core.resolver.ReferenceResolution

class avocado_robot.RobotTest(name, params=None, base_logdir=None, config=None, executable=None)

Bases: avocado.core.test.SimpleTest

Run a Robot command as a SIMPLE test.

Initializes the test.

Parameters
  • methodName – Name of the main method to run. For the sake of compatibility with the original unittest class, you should not set this.

  • name (avocado.core.test.TestID) – Pretty name of the test name. For normal tests, written with the avocado API, this should not be set. This is reserved for internal Avocado use, such as when running random executables as tests.

  • base_logdir – Directory where test logs should go. If None provided a temporary directory will be created.

  • config (dict) – the job configuration, usually set by command line options and argument parsing

property filename

Returns the path of the robot test suite.

test()

Create the Robot command and execute it.

avocado_robot.find_tests(reference, test_suite)