class Bauxite::Application

bauxite command-line program.

This program executes Bauxite tests and outputs the execution progress and tests results to the terminal.

Synopsis

bauxite [OPTIONS] file1 file2 ...
# => Executes file1, then file2, and so on.

bauxite [OPTIONS] -d
# => Start Bauxite directly in the debug console.

bauxite [OPTIONS]
# => Start Bauxite and read test actions from the standard input.

Options

For a detailed list of options for your Bauxite version execute:

bauxite -h
-v, --verbose

Show verbose error messages (i.e. print exception names and backtraces).

-t, --timeout SECONDS

Number of seconds to wait before issuing a timeout error. This timeout applies only to Selectors.

-o, --open_timeout SECONDS

Number of seconds to wait before issuing a timeout error. This timeout applies only to page loading times (i.e. Net::HTTP).

-d, --debug

If an error occurs, break into the debug console. This mode is very useful to try different selector combinations and debug NoSuchElementError errors.

-p, --provider DRIVER

Selenium WebDriver provider. Defaults to firefox.

Other options include:

  • remote

  • ie

  • chrome

  • android

  • iphone

  • opera

  • phantomjs

  • safari

Driver availability dependes on the system running Bauxite.

-P, --provider-option OPTION

A name=value pair of options that are directly forwarded to the Selenium WebDriver provider. This option argument can appear multiple times in the command line to specify multiple options.

-l, --logger LOGGER

Logger instance to use. Defaults to xterm if the TERM environment variable is set to xterm, otherwise it defaults to terminal.

To see a complete list of the available loggers execute:

bauxite -h

Note that multiple instances of this option can be specified.

-L, --logger-option OPTION

A name=value pair of options that are directly forwarded to the logger. This option argument can appear multiple times in the command line to specify multiple options.

-r, --reset

Issue a Bauxite::Action#reset action between every test specified in the command line. This option enforces test isolation by resetting the test context before each test (this removes cookies, sessions, etc. from the previous test).

-w, --wait

Wait for user input when the test completes instead of closing the browser window.

-s, --selector SELECTOR

Default selector strategy. This strategy is applied if the selector text does not contain an = sign.

To see a complete list of the available selectors execute:

bauxite -h
-c, --capture

If the test fails, capture a screenshot in the output directory. See the --output option below.

--csv-summary FILE

Output a single-line CSV summary ideal to feed into the Plot Jenkins plugin. If FILE is not specified, defaults to summary.csv

--output DIR

Output directory for generated artifacts. Defaults to the current working directory.

-u, --url URL

This option is an alias of:

-p remote -P url=URL

If URL is not present http://localhost:4444/wd/hub will be assumed.

--jenkins DIR

Configures default options for Jenkins integration. This option is an alias of:

-p remote -P url=http://localhost:4444/wd/hub -l echo -l html
-L html_package=true -c --csv-summary
--output DIR

Note that any of the options above can be overridden by specifying the option after the --jenkins option. For example:

--jenkins -u selenium.my-organization.com:4445
-e, --extension DIR

Loads every Ruby file (*.rb) inside DIR (and subdirectories). This option can be used to load custom Bauxite extensions (e.g. Actions, Selectors, Loggers, etc.) for a specific test run.

For example:

# === custom/my_selector.rb ======= #
class Bauxite::Selector
    def by_attr(value)
        attr "by_attr:#{value}"
    end
end
# === end custom/my_selector.rb === #

# === custom/my_test.bxt ========== #
# ...
assert "by_attr=attr_value" hello
# ...
# === end custom/my_test.bxt ====== #

bauxite -e custom custom/my_test.bxt
--version

Shows the Bauxite version.

Exit Status

The bauxite program exits with zero if every action in the test succeeded and non-zero otherwise.

If the test run includes multiple Bauxite::Action#test actions, the exit status equals the number of failed test cases (again, zero indicates success).