Running Tests

Test All Things!

TestBox tests can be run from different sources from what we call Runners. These can be from different sources:

  • CLI

    • TestBox CLI (Powered by CommandBox)

    • BoxLang Scripts

    • NodeJS

  • Web Server

    • Runner

    • TestBundle Directly

  • Custom

Your test harness already includes the web runner: runner.bx or runner.cfm. You can execute that directly in your browser to get the results or run it via the CLI: testbox run. We invite you to explore the different runners available to you.

CommandBox RunnerWeb RunnerBundle(s) RunnerDirectory RunnerANT RunnerNodeJS RunnerGlobal RunnerTest Browser

Custom Runners

However, you can create your own custom runners as long as you instantiate the TestBox class and execute one of it's runnable methods. The main execution methods are:

We encourage you to read the API docs included in the distribution for the complete parameters for each method.

run()

Here are the arguments you can use for initializing TestBox or executing the run() method

  • The bundles argument which can be a single CFC path or an array of CFC paths or a directory argument so it can go and discover the test bundles from that directory.

  • The reporter argument can be a core reporter name like: json,xml,junit,raw,simple,dots,tap,min,etc or it can be an instance of a reporter CFC.

  • You can execute the runners from any cfm template or any CFC or any URL, that is up to you.

Was this helpful?