cumulusci.tasks.robotframework.debugger package

Submodules

Robot Debugger

class cumulusci.tasks.robotframework.debugger.DebugListener.DebugListener(*breakpoints)[source]

Bases: object

A robot framework listener for debugging test cases

This acts as the controller for the debugger. It is responsible for managing breakpoints, and pausing execution of a test when a breakpoint is hit.

The listener is also responsible for instantiating the debugger UI (class DebuggerCli).

ROBOT_LISTENER_API_VERSION = 2
break_if_breakpoint()[source]

Pause test execution and issue a prompt if we are at a breakpoint

do_step()[source]

Single-step through the code

This will set a temporary breakpoint on the next keyword in the current context before continuing. Once the breakpoint is hit, it will be removed from the list of breakpoints.

end_keyword(name, attrs)[source]
end_suite(name, attrs)[source]
end_test(name, attrs)[source]
start_keyword(name, attrs)[source]
start_suite(name, attrs)[source]
start_test(name, attrs)[source]
class cumulusci.tasks.robotframework.debugger.model.Base(name, attrs)[source]

Bases: object

Base class for keywords, testcases, and suites

This is mainly used to store the data passed to use from the listener methods.

longname
class cumulusci.tasks.robotframework.debugger.model.Breakpoint(breakpoint_type, pattern, temporary=False)[source]

Bases: object

A breakpoint

Parameters:
  • breakpoint_type – class of object to break on; currently only Keyword is supported. Eventually I want to support setting breakpoints when a suite or test case is first started, before any keywords run.
  • pattern – glob-style pattern to match against the current step
  • temporary – if True, the breakpoint is removed once it triggers. Used for setting temporary breakpoints for stepping through the code

Note: when a breakpoint is encountered, a string will be formed with the fully qualified name of the current testcase and the fully qualified name of the current keyword, separated with “::”

The breakpoint pattern will be matched against this string.

Example:
Root_suite.sub_suite.a test case::BuiltIn.log

To break on the “Salesforce.breakpoint” keyword in any test, the breakpoint could use any one of these patterns depending on how precise you want to be:

  • *::cumulusci.robotframework.Salesforce.Breakpoint
  • *::*.Breakpoint
  • *.Breakpoint
match(context)[source]

Return True if the breakpoint matches the current context

class cumulusci.tasks.robotframework.debugger.model.Keyword(name, attrs)[source]

Bases: cumulusci.tasks.robotframework.debugger.model.Base

class cumulusci.tasks.robotframework.debugger.model.Suite(name, attrs)[source]

Bases: cumulusci.tasks.robotframework.debugger.model.Base

class cumulusci.tasks.robotframework.debugger.model.Testcase(name, attrs)[source]

Bases: cumulusci.tasks.robotframework.debugger.model.Base

class cumulusci.tasks.robotframework.debugger.ui.DebuggerCli(listener, stdout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]

Bases: cmd.Cmd, object

default(line)[source]

Ignore lines that begin with #

do_continue(arg=None)[source]

Let the test continue

do_locate_elements(locator)[source]

Find and highlight all elements that match the given selenium locator

Example:

rdb> locate_elements //button[@title=’Learn More’]
do_pdb(arg=None)[source]

Start pdb

The context will be this function, which won’t be particularly useful. This is mostly for debugging the debug code. How meta!

do_quit(arg=None)[source]

Cause robot to quit gracefully (all remaining tests will be skipped)

do_reset_elements(arg=None)[source]

Remove all highlighting added by locate_elements

do_shell(arg)[source]

Execute a robot framework keyword. (shortcut: !)

The statement should be formatted just like in a .robot file, with two spaces between each argument.

Example:

rdb> shell log hello, world -or- rdb> ! log hello, world

Variables can be specified the same as in a robot file. For example, this will set a test variable named ${location}:

rdb> shell ${location} get location
do_step(arg=None)[source]

Run the next step in the test

This will run the line where the test is currently paused, and then stop at the next keyword in the same test case.

do_vars(arg=None)[source]

Print the value of all known variables

do_where(arg=None)[source]

Print the current robot stack (hierarchy of suites and tests, ending with the current keyword

intro = '\n:::\n::: Welcome to rdb, the Robot Framework debugger\n:::\n\nType help or ? to list commands.\n'
prompt = 'rdb> '
selenium

Module contents