Skip to content

Lawo/nmos-server-api-tests

Repository files navigation

Readme

The nmos-server-api-tests project provides automated tests for the Query-, Node- and Registration-APIs of any given NMOS-server implementation.

This Node.js-project is written in Typescript. It uses the Mocha Javascript test framework and the Chai Assertion Library. The chai-http-plugin is used to extend Chai Assertion Library with tests for http-APIs. The chai-json-schema-plugin is used to validate API-responses against JSON schema.

Up to now the project tests NMOS v1.0 specification. The API-raml-files and the schemas were copied into this project from AMWA-TV/nmos-discovery-registration. It is planned to use the git submodule mechanism in the future to avoid the copies and get the files directly from the AMWA-TV/nmos-discovery-registration-github repository.

Getting Ready

  • Install Node.js for your platform
  • Get the sources into a directory of your choice
      git clone https://github.com/Lawo/nmos-server-api-tests.git
      
  • Change to the directory chosen for the sources and type
      npm install
      
  • If not running already, start the NMOS-server to be tested.

Now everything is ready to run the tests.

Run Tests

There are two test-scripts available: test and test-xunit.

test

The test results will be displayed in the console.

npm run test --host=192.168.1.76 --node_port=12345 --query_port=8870 --registration_port=8235

test-xunit

The test results will be written into the file test-reports.xml in xUnit-format. This comes in handy when integrating the tests into a CI-System.

npm run test-xunit --host=192.168.1.76 --node_port=12345 --query_port=8870 --registration_port=8235

Host and Port specification

Host and ports may be specified from the command line when running the tests.

Host

The ip-address of the NMOS-server to be tested.

--host=192.168.1.76

If no host is specified the default value localhost is used.

Port

For each of the Node-, Query- and Registration-API a separate port may be specified.

--node_port=12345
--query_port=8870
--registration_port=8235

If no port is specified the default value 15631 is used.

Debug Tests

For users of Visual Studio Code everything is prepared to debug the tests.

  • Open project in Visual Studio Code
  • Install workspace recommended extensions. Hit F1, type work and select Extensions: Show Workspace Recommended Extensions
  • Specify Host and Port in the file .vscode/launch.env
  • Run build task. Hit Ctrl, Shift and B
  • Set breakpoints in any ts-files using F9.
  • Debug the tests. Hit F5 to start.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •