LogoLogo
HomeAPIBlog
3.0.0-SNAPSHOT
3.0.0-SNAPSHOT
  • INTRODUCTION
    • Getting Started
      • Running Local Development Servers
      • Beginner Tutorial: Hello World
      • Beginner Tutorial: Hello Database
      • Tutorial: Wheels, AJAX, and You
    • Frameworks and Wheels
    • Requirements
    • Manual Installation
    • Upgrading
    • Screencasts
  • Command Line Tools
    • CLI Overview
    • Quick Start Guide
    • Command Reference
      • Core Commands
        • wheels init
        • wheels info
        • wheels reload
        • wheels deps
        • wheels destroy
        • wheels watch
      • Code Generation
        • wheels generate app
        • wheels generate app-wizard
        • wheels generate controller
        • wheels generate model
        • wheels generate view
        • wheels generate property
        • wheels generate route
        • wheels generate resource
        • wheels generate api-resource
        • wheels generate frontend
        • wheels generate test
        • wheels generate snippets
        • wheels scaffold
      • Database Commands
        • wheels dbmigrate info
        • wheels dbmigrate latest
        • wheels dbmigrate up
        • wheels dbmigrate down
        • wheels dbmigrate reset
        • wheels dbmigrate exec
        • wheels dbmigrate create blank
        • wheels dbmigrate create table
        • wheels dbmigrate create column
        • wheels dbmigrate remove table
        • wheels db schema
        • wheels db seed
      • Testing Commands
        • wheels test
        • wheels test run
        • wheels test coverage
        • wheels test debug
      • Configuration Commands
        • wheels config list
        • wheels config set
        • wheels config env
      • Environment Management
        • wheels env
        • wheels env setup
        • wheels env list
        • wheels env switch
      • Plugin Management
        • wheels plugins
        • wheels plugins list
        • wheels plugins install
        • wheels plugins remove
      • Code Analysis
        • wheels analyze
        • wheels analyze code
        • wheels analyze performance
        • wheels analyze security
      • Security Commands
        • wheels security
        • wheels security scan
      • Performance Commands
        • wheels optimize
        • wheels optimize performance
      • Documentation Commands
        • wheels docs
        • wheels docs generate
        • wheels docs serve
      • CI/CD Commands
        • wheels ci init
      • Docker Commands
        • wheels docker init
        • wheels docker deploy
      • Deployment Commands
        • wheels deploy
        • wheels deploy audit
        • wheels deploy exec
        • wheels deploy hooks
        • wheels deploy init
        • wheels deploy lock
        • wheels deploy logs
        • wheels deploy proxy
        • wheels deploy push
        • wheels deploy rollback
        • wheels deploy secrets
        • wheels deploy setup
        • wheels deploy status
        • wheels deploy stop
    • CLI Development Guides
      • Creating Commands
      • Service Architecture
      • Migrations Guide
      • Testing Guide
  • Working with Wheels
    • Conventions
    • Configuration and Defaults
    • Directory Structure
    • Switching Environments
    • Testing Your Application
    • Using the Test Environment
    • Contributing to Wheels
    • Submitting Pull Requests
    • Documenting your Code
  • Handling Requests with Controllers
    • Request Handling
    • Rendering Content
    • Redirecting Users
    • Sending Files
    • Sending Email
    • Responding with Multiple Formats
    • Using the Flash
    • Using Filters
    • Verification
    • Event Handlers
    • Routing
    • URL Rewriting
      • Apache
      • IIS
      • Tomcat
      • Nginx
    • Obfuscating URLs
    • Caching
    • Nesting Controllers
    • CORS Requests
  • Displaying Views to Users
    • Pages
    • Partials
    • Linking Pages
    • Layouts
    • Form Helpers and Showing Errors
    • Displaying Links for Pagination
    • Date, Media, and Text Helpers
    • Creating Custom View Helpers
    • Localization
  • Database Interaction Through Models
    • Object Relational Mapping
    • Creating Records
    • Reading Records
    • Updating Records
    • Deleting Records
    • Column Statistics
    • Dynamic Finders
    • Getting Paginated Data
    • Associations
    • Nested Properties
    • Object Validation
    • Object Callbacks
    • Calculated Properties
    • Transactions
    • Dirty Records
    • Soft Delete
    • Automatic Time Stamps
    • Database Migrations
      • Migrations in Production
    • Using Multiple Data Sources
  • Plugins
    • Installing and Using Plugins
    • Developing Plugins
    • Publishing Plugins
  • Project Documentation
    • Overview
  • External Links
    • Source Code
    • Issue Tracker
    • Sponsor Us
    • Community
Powered by GitBook
LogoLogo
On this page
  • Synopsis
  • Description
  • Arguments
  • Options
  • Test Types
  • Core Tests
  • App Tests
  • Plugin Tests
  • Examples
  • Run app tests (default)
  • Run core framework tests
  • Run tests on specific server
  • Run with debug output
  • Skip reload
  • Output Example
  • Framework Test Categories
  • Model Tests
  • Controller Tests
  • View Tests
  • Dispatcher Tests
  • Configuration
  • Test Settings
  • Test Database
  • Debugging Failed Tests
  • Enable debug mode
  • Check specific test file
  • Common issues
  • Continuous Integration
  • GitHub Actions
  • Jenkins
  • Custom Framework Tests
  • Performance Testing
  • Test Isolation
  • Troubleshooting
  • Tests won't run
  • Reload issues
  • Memory issues
  • Best Practices
  • Difference from TestBox Tests
  • See Also

Was this helpful?

Edit on GitHub
Export as PDF
  1. Command Line Tools
  2. Command Reference
  3. Testing Commands

wheels test

Run Wheels framework tests (core, app, or plugin tests).

Synopsis

wheels test [type] [servername] [options]

Description

The wheels test command runs the built-in Wheels framework test suite. This is different from wheels test run which runs your application's TestBox tests. Use this command to verify framework integrity or test Wheels plugins.

Arguments

Argument
Description
Default

type

Test type: core, app, or plugin

app

servername

CommandBox server name

Current server

Options

Option
Description
Default

--reload

Reload before running tests

true

--debug

Show debug output

false

--format

Output format

simple

--adapter

Test adapter

testbox

--help

Show help information

Test Types

Core Tests

wheels test core
  • Tests Wheels framework functionality

  • Verifies framework integrity

  • Useful after framework updates

App Tests

wheels test app
  • Runs application-level framework tests

  • Tests Wheels configuration

  • Verifies app-specific framework features

Plugin Tests

wheels test plugin
  • Tests installed Wheels plugins

  • Verifies plugin compatibility

  • Checks plugin functionality

Examples

Run app tests (default)

wheels test

Run core framework tests

wheels test core

Run tests on specific server

wheels test app myserver

Run with debug output

wheels test --debug

Skip reload

wheels test --reload=false

Output Example

╔═══════════════════════════════════════════════╗
║           Running Wheels Tests                ║
╚═══════════════════════════════════════════════╝

Test Type: app
Server: default
Reloading: Yes

Initializing test environment...
✓ Environment ready

Running tests...

Model Tests
  ✓ validations work correctly (15ms)
  ✓ associations load properly (23ms)
  ✓ callbacks execute in order (8ms)

Controller Tests
  ✓ filters apply correctly (12ms)
  ✓ caching works as expected (45ms)
  ✓ provides correct formats (5ms)

View Tests
  ✓ helpers render correctly (18ms)
  ✓ partials include properly (9ms)
  ✓ layouts apply correctly (11ms)

Plugin Tests
  ✓ DBMigrate plugin loads (7ms)
  ✓ Scaffold plugin works (22ms)

╔═══════════════════════════════════════════════╗
║              Test Summary                     ║
╚═══════════════════════════════════════════════╝

Total Tests: 11
Passed: 11
Failed: 0
Errors: 0
Time: 173ms

✓ All tests passed!

Framework Test Categories

Model Tests

  • Validations

  • Associations

  • Callbacks

  • Properties

  • Calculations

Controller Tests

  • Filters

  • Caching

  • Provides/formats

  • Redirects

  • Rendering

View Tests

  • Helper functions

  • Form helpers

  • Asset helpers

  • Partials

  • Layouts

Dispatcher Tests

  • Routing

  • URL rewriting

  • Request handling

  • Parameter parsing

Configuration

Test Settings

In /config/settings.cfm:

<cfset set(testEnvironment=true)>
<cfset set(testDataSource="myapp_test")>

Test Database

Create separate test database:

CREATE DATABASE myapp_test;

Debugging Failed Tests

Enable debug mode

wheels test --debug

Check specific test file

Failed: Model Tests > validations work correctly
File: /tests/framework/model/validations.cfc
Line: 45
Expected: true
Actual: false

Common issues

  1. Database not configured: Check test datasource

  2. Reload password wrong: Verify settings

  3. Plugin conflicts: Disable plugins and retest

  4. Cache issues: Clear cache and retry

Continuous Integration

GitHub Actions

- name: Run Wheels tests
  run: |
    box install
    box server start
    wheels test core
    wheels test app

Jenkins

stage('Framework Tests') {
    steps {
        sh 'wheels test core'
        sh 'wheels test app'
    }
}

Custom Framework Tests

Add tests in /tests/framework/:

component extends="wheels.Test" {

    function test_custom_framework_feature() {
        // Test custom framework modification
        actual = customFrameworkMethod();
        assert(actual == expected);
    }

}

Performance Testing

Run with timing:

wheels test --debug | grep "Time:"

Monitor slow tests:

✓ complex query test (523ms) ⚠️ SLOW
✓ simple validation (8ms)

Test Isolation

Tests run in isolation:

  • Separate request for each test

  • Transaction rollback (if enabled)

  • Clean application state

Troubleshooting

Tests won't run

# Check server is running
box server status

# Verify test URL
curl http://localhost:3000/wheels/tests

Reload issues

# Manual reload first
wheels reload

# Then run tests
wheels test --reload=false

Memory issues

# Increase heap size
box server set jvm.heapSize=512
box server restart

Best Practices

  1. Run before deployment

  2. Test after framework updates

  3. Verify plugin compatibility

  4. Use CI/CD integration

  5. Keep test database clean

Difference from TestBox Tests

Feature

wheels test

wheels test run

Purpose

Framework tests

Application tests

Framework

Wheels Test

TestBox

Location

/wheels/tests/

/tests/

Use Case

Framework integrity

App functionality

See Also

  • wheels reload - Reload application

PreviousTesting CommandsNextwheels test run

Last updated 2 days ago

Was this helpful?

- Run TestBox application tests

- Generate coverage reports

- Debug test execution

wheels test run
wheels test coverage
wheels test debug