= Checkbox Tips & Tricks =

Tips and tricks for running/modifying [[Testing/Automation/Checkbox|Checkbox]].

== Logging ==

Specifying the log level:
{{{
--log-level=(debug|info|warning|error|critical)
}}}

Specifying the log location:
{{{
--log=/path/to/file
}}}

== Running tests as a normal user ==

{{{
checkbox-cli --config="checkbox/plugins/blacklist=permission_prompt"
}}}

== Using regular expressions ==

Regular expressions can be used to register events:
{{{
self._manager.reactor.call_on("report.*", self.report)
}}}

The report method will be called for all events starting with "report".

== Avoid loading plugins that are in the plugins default directory ==

In the configuration file, add the blacklist field with the plugins to avoid (space separated)
{{{
[checkbox/plugins]
blacklist = plugin_to_avoid
}}}

<<Anchor(DisablingTestButton)>>
== Disabling Test button when using command output in the description ==

To disable the Test button in the GTK interface when the command output is just to be used in the description, move the command name to the description. That is to say, instead of writing something such as:
{{{
name: test-button-enabled
plugin: manual
command: some_command
description:
 This is the command output:
 .
 $output
}}}

The test case may be written as follows:
{{{
name: test-button-disabled
plugin: manual
description:
 This is the command output:
 .
 $(some_command)
}}}