LogoLogo
OverviewDemos and ResourcesContact
  • What is Engine?
  • Key Concepts
    • Drivers
    • Modules
    • Systems
    • Zones
    • Settings
    • Interfaces
    • Triggers
  • Security
  • Deployment
    • System Architecture
    • Single Sign-On
      • Configuring Engine for SAML2
      • SAML2 with Azure AD
      • SAML2 with ADFS
      • SAML2 with Auth0
      • SAML2 with GSuite
      • OAuth2
  • Integrations
    • Supported Integrations
    • Directory Services
      • Microsoft Office365
    • IoT
      • Device Drivers
      • Node-RED
      • Azure IOT Hub
    • Location Services
      • Locating Users on a Network
      • SVG Map Creation
      • Cisco CMX
      • Cisco Meraki RTLS
      • Desk Sensors
  • Administration
    • Backoffice
      • Systems
      • Devices
      • Drivers
      • Zones
      • Triggers
      • Metrics
      • Users
      • Domains
        • Applications
  • Developer Guide
    • Development Environment
    • Building Drivers
      • Discovery and Metadata
      • State
      • Scheduling Actions
      • Response Tokenisation
      • Device Drivers
      • SSH Drivers
      • Service Drivers
      • Logic Drivers
      • Testing
      • Live Monitoring
      • Logging
      • Security
      • Utilities and Helpers
    • User Interfaces
      • Composer
      • Virtual Systems
      • Widgets
      • Settings.json
  • API
    • Authentication
    • Control
      • Systems
      • Modules
      • Dependencies
      • Zones
      • Websocket
        • Commands
          • bind
          • unbind
          • exec
          • debug
          • ignore
        • Heartbeat
        • Errors
  • Support
    • Service Desk
Powered by GitBook
On this page
  • Checking Values
  • Helper Functions
  • Debugging
  • Running Tests

Was this helpful?

  1. Developer Guide
  2. Building Drivers

Testing

PreviousLogic DriversNextLive Monitoring

Last updated 5 years ago

Was this helpful?

Tests describe the behaviour of a driver and can be used to help with development. They are also useful in describing the intended usage of a driver.

For example usage, see:

    • Waits for login prompt before processing commands

    • Waits for encryption key

    • Injects password before transmitting data

Checking Values

The Engine test framework uses for verifying status variables and command results returned expected values.

Helper Functions

Helper

Arguments

Description

transmit / responds

string / hex string / byte array

emulates a device sending data to the module

exec

function_name, *arguments

calls the function requested on the module with the arguments provided

should_send

string / hex string / byte array

this is the data the driver is expected to send to the device

result

provides access to the result of the last executed request

status

provides access to the current status of the driver

temporary_disconnect

emulates a connection drop followed by re-establishment

device_offline

emulates a connection drop where communications have failed to be re-established

device_online

emulates connection re-establishment. Should only be called after a device_offline

wait_tick

times = 1

resumes the test after the specified number of ticks through the event loop

wait

milliseconds

resumes the test after waiting the specified amount of time

Debugging

  1. Step through code one line at a time

  2. Pause the driver at some event or specified instruction, to examine the current state.

  3. Interact with the state by executing code dynamically at the breakpoint

Byebug Resources:

Running Tests

There is a rake task where you can specify the file containing the driver spec. Drivers themselves are resolved and loaded internally, as they would be in a running system.

  • rake module:test['../aca-device-modules/modules/extron/switcher/dxp_spec.rb']

  • Your system is scanned and spec files are listed on the right

  • Selecting a spec will attempt to load the driver file

    • You will see any load errors that occur (such as syntax errors)

    • Discovery information is listed in a table

    • The test is executed in an interactive console, allowing for interactive debugging

    • Click the refresh icon to re-run the test at any point

makes it possible to

To simplify the process of running tests, when using the , you can run tests in the browser.

Extron DXP spec
Denon BluRay spec
ClearOne Converge spec
Panasonic Projector spec
rspec-expectations
Byebug
Usage Tutorial
Video Tutorial
development setup