For the complete documentation index, see llms.txt. This page is also available as Markdown.

Running Tests

Gathering coverage and test information using the SeaLights Node.js Test Listener is done in a few steps.

There are 4 basic steps to gathering coverage and test information using the SeaLights Node.js Agent (slnodejs).

  1. Start the test stage with slnodejs start ...

  2. Run the Tests

  3. Upload Test Reports

  4. End the test stage with slnodejs end...

Use the Lab ID to connect the test listener to the application under test. For Unit Tests, see Unit Tests.

Starting the Test Stage

First, the SeaLights server needs to be notified that a test stage is starting.

npx slnodejs start \
  --tokenFile /path/to/sltoken.txt \
  --labId "<Lab ID>" \
  --testStage "Functional Tests"

See Test Listener - Opening a Test Stage (start) for full parameter details

Running your tests

Functional Tests

Before running your functional tests you need to set up the backend server to receive the test footprints. See Running Backend Server

Once set up you now run your tests normally while generating one or more JUnit XML result files to be reported to the SeaLights server.

Unit Tests

As the Unit Tests are not run against a backend server, you need to run the actual tests using the Sealights Node.js Agent while generating one or more JUnit XML result files to be reported to the SeaLights server. Note that both Junit and Coverage reports must be uploaded for SeaLights to reflect data for your Unit Tests.

For clarification, see: Unit Tests

Upload report files

Test Case JUnit Report

The slnodejs uploadReports command can be used to upload the junit.xml file.

Coverage (nyc) Report

The slnodejs uploadReports command can be used to upload the coverage file generated by nyc.

Ending the Test Stage

Finally, notify the server that a test stage has ended.

See Test Listener - Upload Coverage Files (nycReport) for full parameter details

Last updated

Was this helpful?