Skip to content
Grzegorz Pabian edited this page Feb 24, 2015 · 6 revisions

Bender.js exposes a command-line interface. At the moment you can use following commands:

If you want to see more details for any of below commands, execute it with -h or --help flag.

init

Initializes Bender in current working directory. It means that the basic file structure required by Bender is created:

  • /.bender/ directory - contains cache, databases, and local configuration file
  • /.bender/bender.js file - contains local configuration for the project
  • /bender.js file - project's Bender configuration

If any of the above files already exists, it's not being overridden.

run

Runs the tests in a browser and output the results to the console.

You can optionally specify an ID of a test you wish to run in a browser.

This command accepts following options:

  • -b or --browser - name of the browser to start, default: phantomjs
  • -l or --list - optional flag telling Bender to list all available browsers
  • -p or --port - port on which Bender will listen, default: 1030
  • -H or --host - host name used to run Bender, default: 0.0.0.0
  • -c or --config - path to alternative project's configuration file, default: bender.js

server run

Starts Bender server in verbose mode - all the logs and errors will be logged to STDOUT.

This command accepts following options:

  • -p or --port - port on which the server will listen, default: 1030
  • -H or --host - host name used to run the server, default: 0.0.0.0
  • -c or --config - path to alternative project's configuration file, default: bender.js

server start

Starts Bender server in the background. All of the logs will be stored in two files:

  • bender-out.log - standard logs
  • bender-err.log - error messages

This command accepts all of the options available for server run command.

You can check the status of the server using bender server status commend described below.

Warning: at the moment server start command does not work on Windows, please use server run instead.

server stop

Stops Bender server running in the background.

You can optionally specify a UID of a server you wish to stop, otherwise it will try to stop a Bender server daemon running in the current directory.

A server's UID can be obtained with bender server list command.

server status

Shows the status of Bender server running in the background.

server list

Lists all Bender server daemons running in the background.

version

Displays current Bender version.

Note: Deprecated since 0.2.2, please use -v/--version flag instead.

clean

Dangerous!

Clears Bender's cache and wipes the databases. Meaning it will remove all the jobs and all of its tests.

It does not affect Bender's local and project configurations.

Clone this wiki locally