TestBox : Behavior Driven Development (BDD)
API DocsSourceSupportBoxLang
v5.x
v5.x
  • Introduction
    • Release History
      • What's New With 5.3.x
      • What's new With 5.2.0
      • What's New With 5.1.0
      • What's New With 5.0.0
    • About This Book
      • Author
  • Getting Started
    • Overview
    • Installation
      • IDE Tools
      • MXUnit Compatibility
    • Writing Tests
    • Running Tests
      • BoxLang CLI Runner
      • CommandBox Runner
      • Web Runner
      • Bundle(s) Runner
      • Directory Runner
      • ANT Runner
      • NodeJS Runner
      • Global Runner
      • Test Browser
    • BDD Tests
      • Bundles: Group Your Tests
      • Suites: Describe Your Tests
        • Dynamic Suites
      • Specs
      • Expectations
      • Suite Groups
        • Given-When-Then Blocks
      • Life-Cycle Methods
      • Life-Cycle Data Binding
      • Specs and Suite Labels
      • Skipping Specs and Suites
      • Focused Specs and Suites
      • Spies & Mocking
      • Asynchronous Testing
      • Running Tests
      • Reporters
    • xUnit Tests
      • Test Bundles
      • Life-Cycle Methods
      • Test Methods
      • Assertions
      • Test and Suite Labels
      • Skipping Tests and Suites
      • Spies and Mocking
      • Asynchronous-Testing
      • Running Tests
      • Reporters
  • Digging Deeper
    • Life-Cycle Annotations
    • Assertions
      • Custom Assertions
    • Expectations
      • Matchers
      • Not Operator
      • Expecting Exceptions
      • Custom Matchers
    • Output Utilities
    • Runner Listeners
    • Reporters
      • Custom Reporters
    • Modules
    • Code Coverage
      • Running Code Coverage
      • Configuring Code Coverage
      • Known Behaviors
    • Continous Integration
      • Github Actions
      • Gitlab
      • Travis
  • Mocking
    • MockBox
      • What is Mocking?
      • Our Approach and Benefits
      • Creating MockBox
      • Creating a Mock Object
      • Creating a Stub Object
      • Mocking Methods
        • $() Method
        • $args() Method
        • $getProperty() Method
        • $property() Method
        • $querySim() Method
        • $results() Method
        • $spy()
        • $throws() Method
      • Verification Methods
        • $count()
        • $times() or $verifyCallCount()
        • $never()
        • $atLeast()
        • $once()
        • $atMost()
        • $callLog()
        • $reset()
        • $debug()
      • Some Examples
      • Conclusion
    • Mocking Data
Powered by GitBook

Social Media

  • YouTube
  • x
  • FaceBook
  • LinkedIn

Downloads

  • CommandBox
  • BoxLang
  • Try BoxLang

Support

  • Professional
  • Community
  • Slack
  • CFCasts

Copyright & Register Trademark by Ortus Solutions, Corp & Ortus Software, LLC

On this page
  • Test Bundle Execution
  • Arguments

Was this helpful?

Edit on GitHub
Export as PDF
  1. Getting Started
  2. Running Tests

Web Runner

PreviousCommandBox RunnerNextBundle(s) Runner

Last updated 8 months ago

Was this helpful?

Every test harness comes with a runner.bx or runner.cfm in the root of the tests folder. This is called the web runner and is executable via the web server you are running your application on. This will execute all the tests by convention found in the tests/specs folder.

http://localhost/tests/runner.cfm

You can open that file and customize it as you see fit. Here is an example of such a file:

<!--- Executes all tests in the 'specs' folder with simple reporter by default --->
<bx:param name="url.reporter" 			default="simple">
<bx:param name="url.directory" 			default="tests.specs">
<bx:param name="url.recurse" 			default="true" type="boolean">
<bx:param name="url.bundles" 			default="">
<bx:param name="url.labels" 			 default="">
<bx:param name="url.excludes" 			 default="">
<bx:param name="url.reportpath" 		 default="#expandPath( "/tests/results" )#">
<bx:param name="url.propertiesFilename"  default="TEST.properties">
<bx:param name="url.propertiesSummary"	default="false" type="boolean">
<bx:param name="url.editor" 			  default="vscode">
<bx:param name="url.bundlesPattern" 	 default="*Spec*.cfc|*Test*.cfc|*Spec*.bx|*Test*.bx">

<!--- Code Coverage requires FusionReactor --->
<bx:param name="url.coverageEnabled"			default="false">
<bx:param name="url.coveragePathToCapture"		default="#expandPath( '/root' )#">
<bx:param name="url.coverageWhitelist"			  default="">
<bx:param name="url.coverageBlacklist"			  default="/testbox,/coldbox,/tests,/modules,Application.cfc,/index.cfm,Application.bx,/index.bxm">
<!---<bx:param name="url.coverageBrowserOutputDir"		default="#expandPath( '/tests/results/coverageReport' )#">--->
<!---<bx:param name="url.coverageSonarQubeXMLOutputPath"	default="#expandPath( '/tests/results/SonarQubeCoverage.xml' )#">--->
<!--- Enable batched code coverage reporter, useful for large test bundles which require spreading over multiple testbox run commands. --->
<!--- <bx:param name="url.isBatched"						default="false"> --->

<!--- Include the TestBox HTML Runner --->
<bx:include template="/testbox/system/runners/HTMLRunner.cfm" >

Test Bundle Execution

If you make your test bundle class inherit from our testbox.system.BaseSpec class, you will be able to execute the class directly via the URL:

// BoxLang
http://localhost/tests/specs/MyFirstTest.bx?method=runRemote

// CFML
http://localhost/tests/specs/MyFirstTest.cfc?method=runRemote

Arguments

All the arguments found in the runner are available as well in a direct bundle execution:

  • labels: The labels to apply to the execution

  • testMethod : A list or array of xunit test names that will be executed ONLY!

  • testSuites : A list or array of suite names that are the ones that will be executed ONLY!

  • testSpecs : A list or array of test names that are the ones that will be executed ONLY!

  • reporter : The type of reporter to run the test with

// BoxLang
http://localhost/tests/specs/MyFirstTest.bx?method=runRemote&reporter=text

// CFML
http://localhost/tests/specs/MyFirstTest.cfc?method=runRemote&reporter=text