TestBox : Behavior Driven Development (BDD)
API DocsSourceSupportBoxLang
v6.x
v6.x
  • Introduction
    • Release History
      • What's New With 6.3.0
      • What's New With 6.2.1
      • What's New With 6.2.0
      • What's New With 6.1.0
      • What's New With 6.0.1
      • What's New With 6.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
  • BoxLang Has Arrived!
  • TestBox CLI
  • BoxLang CLI Runner
  • Engine Support
  • New Environment Helpers
  • New Spec Alias: test()
  • Display Names
  • BoxLang Dynamic Assertions
  • Release Notes
  • New Features
  • Improvements
  • Bugs
  • Tasks

Was this helpful?

Edit on GitHub
Export as PDF
  1. Introduction
  2. Release History

What's New With 6.0.0

September 27, 2024

PreviousWhat's New With 6.0.1NextAbout This Book

Last updated 7 months ago

Was this helpful?

TestBox 6.x series is a major bump in our library. Here are the major areas of improvement and the full release notes.

BoxLang Has Arrived!

Here is a sample Spec written in BoxLang

class extends="testbox.system.BaseSpec"{

    function run(){
	describe( "My First Test", ()=>{
		test( "it can add", ()=>{
			expect( sum( 1, 2 ) ).toBe( 3 )
		} )
	} )
    }

    private function sum( a, b ){
        return a + b
    }

}

TestBox CLI

We have also updated the testbox-cli to now support BoxLang native generation. It will detect if you are in a BoxLang server or if you have the new language entry in your box.json

{
    "name":"MyBoxLang Project",
    "version":"1.0.0",
    "language" : "boxlang" // or CFML or JAVA
}

Also all generation commands have a new boxlang argument, which is a boolean argument you can use to explicitly generate Boxlang code.

testbox create bdd MyTest --boxlang
testbox generate harness --boxlang

The CLI will detect if it's a BoxLang project if:

  • If there is a CommandBox BoxLang server detected in the root of the project

  • If the runner defined in your box.json is called boxlang

  • If the language=boxlang in your box.json is detected

BoxLang CLI Runner

Mac/Linux

./testbox/bin/run
./testbox/bin/run my.bundle
./testbox/bin/run --directory=tests.specs
./testbox/bin/run --bundles=my.bundle

Windows Examples:

./testbox/bin/run.bat
./testbox/bin/run.bat my.bundle
./testbox/bin/run.bat --directory=tests.specs
./testbox/bin/run.bat --bundles=my.bundle

Remember that BoxLang not only allows you to build web server applications, but also CLI applications, serverless (AWS Lambdas, Azure Functions), Android and more.

Headless Web Server Testing

We have also created a new module called bx-web-support which will allow you to do headless web server testing right from the CLI.

// CommandBox
install bx-web-support

// BoxLang OS Binary
install-bx-module bx-web-support

This will add web support to the CLI (BIFS, components, etc.) and a mock HTTP server so you can do full life-cycle testing from the CLI like if running your app in a web server. This runner does not require a web server to function, thus if you are building a web app, you will need this module if you still want to continue to execute your tests in the CLI Runtime.

Engine Support

Adobe 2018 has been dropped and BoxLang is now fully supported and certified with special features JUST for BoxLang.

New Environment Helpers

All the test bundles will now inherit several new methods to assist in environment and OS detection:

Method
Purpose

isAdobe()

Are you running the test in an Adobe CFML Engine

isLucee()

Are you running the test in a Lucee CFML Engine

isBoxLang()

Are you running the test in a BoxLang Engine

isWindows()

Are you in a windows OS

isLinux()

Are you in a Linux OS

isMac()

Are you in a Mac OS

New Spec Alias: test()

We have added a new method for your BDD tests called test() so you can create even further human-readable tests apart from it(), then()

describe("User Authentication", () => {

    test("should successfully login with valid credentials", () => {
        var user = authenticate("validUser", "validPassword");
        expect( user.isAuthenticated() ).toBe(true);
    });

    test("should fail login with invalid credentials", () => {
        var user = authenticate("invalidUser", "invalidPassword");
        expect( user.isAuthenticated() ).toBe(false);
    });

});

Display Names

If you are building your tests in xUnit mode, then you are getting more features especially for your reports. Instead of just seeing the name of the function, you can now annotate it with a displayName annotation and give it a human readable title.

// Before
function testAddition(){
    assert( calc.add(2,3) == 5 )
}

function testMultiply(){
    assert( calc.multiply(2,3) == 6 )
}

// After

@DisplayName "My calculator can add"
function testAddition(){
    assert( calc.add(2,3) == 5 )
}

@DisplayName "My calculator can multiply"
function testMultiply(){
    assert( calc.multiply(2,3) == 6 )
}
// Before
function testAddition(){
    assert( calc.add(2,3) == 5 )
}

function testMultiply(){
    assert( calc.multiply(2,3) == 6 )
}

// After

function testAddition() DisplayName="My calculator can add"{
    assert( calc.add(2,3) == 5 )
}

function testMultiply() DisplayName="My calculator can multiply"{
    assert( calc.multiply(2,3) == 6 )
}

BoxLang Dynamic Assertions

If you are writing your specs in BoxLang you will start to get further advantages than in CFML. Here is the first one, dynamic assertion methods. Before, in order to use the assertions library you had to use the $assert variable and call the assertion methods on it:

$assert.isTrue()
$assert.isFalse()
$assert.isEqual()
$assert.isNotEqual()
$assert.null()

Now, you can use our dynamic delegator and just simply your assertions:

assertIsTrue()
assertIsFalse()
assertIsEqual()
assertIsNotEqual()
assertNull()

Release Notes

New Features

Improvements

Bugs

Tasks

is the newest JVM language that can support running not only BoxLang language files but CFML files with our bx-compat-cfml module. In TestBox 6 we now not only support and certify that it runs in CFML compatibility mode, but you can now create all your tests, specs and harnesses in BoxLang. You can find the base test harness for BoxLang here:

We have also created a new runner for BoxLang exclusively. This runner allows you to run your specs, and bundles from the CLI with no web server required. You can find the entire docs for the runner in our page. The runner must be run from the root of your BoxLang project:

If you are building exclusively a web application, we suggest you use the which will call your runner via HTTP from the CLI. You can also just use the .

All these dynamic methods will proxy to the

MockBox converted to script

BoxLang classes support

New environment helpers to do skip detections or anything you see fit: isAdobe, isLucee, isBoxLang, isWindows, isMac, isLinux

new `test(), xtest(), ftest()` alias for more natuarl testing

debug() get's two new arguments: label and showUDFs

DisplayName on a bundle now shows up in the reports

xUnit new annotation for @DisplayName so it can show instead of the function name

BoxLang CLI mode and Runner

New matcher: toHaveKeyWithCase()

Assertions: key() and notKey() now have a CaseSensitive boolean argument

showUDFs = false option with debug()

TextReporter doesn't correctly support testBundles URL param

adding missing focused argument to spec methods

Generating a repeatable id for specs to track them better in future UIs

If test spec descriptor contains a comma, it can not be drilled down to run that one spec directly

describe handler in non-called test classes being executed

Drop Adobe 2018 support

BoxLang
https://github.com/Ortus-Solutions/TestBox/tree/development/bx/tests
CommandBox runner
Web Runner
assertions library.
TESTBOX-391
TESTBOX-392
TESTBOX-393
TESTBOX-394
TESTBOX-397
TESTBOX-398
TESTBOX-399
TESTBOX-401
TESTBOX-402
TESTBOX-403
TESTBOX-289
TESTBOX-331
TESTBOX-395
TESTBOX-396
TESTBOX-123
TESTBOX-338
TESTBOX-400
BoxLang CLI Runner
www.boxlang.io