CresDbg is a JavaScript and Cucumber-based test framework for Crestron SIMPL programs.
Click "Use this template" to create a new repository based on this one, or clone the repository directly.
git clone git@github.com:locimation/cresdbg.git2. Write tests in plain English using Gherkin syntax.
Tests should appear in the features/ directory.
Do not modify the step definitions in the
features/steps/directory.
Each feature file must have a Background section that sets the IP address, username, and password of the control processor (see below).
There are three valid step types that can be used to set the test stimulus:
Given "my_digital_signal" set to 1 for 50 msGiven "my_analog_signal" set to 50Given "my_serial_signal" set to "Hello, world!"
Note: the
for 50mspart of the first step is optional. If omitted, the signal will be set indefinitely.
There are then two valid step type that can be used to check the test response:
Then "my_digital_or_analog_signal" should be 1Then "my_serial_signal" should be "Hello, world!"
# features/interlock.feature
Feature: Crestron Test Demo
Background:
Given a control processor at "192.168.0.10"
And a username of "crestron"
And a password of "password"
Scenario: Interlock
Given "interlock1_ps" set to 1 for 50 ms
Then "interlock1_fb" should be 1
And "interlock2_fb" should be 0
And "interlock2_fb" should be 0
A compherensive sample test has been provided in the features/sample.feature file.
Remember to remove this file before running your tests!
yarn test
yarn run v1.22.22
$ cucumber-js
....
1 scenarios (1 passed)
4 steps (4 passed)
0m02.692s (executing steps: 0m02.666s)
✨ Done in 3.54s.
