Support & information center

Assertion and expectation commands

testRTC offers specialized assertion and expectation commands that are meant to automatically determine the pass/failure status of a test run or a monitor run.

These mechanisms are listed here:

Expectations

Expectations are special testRTC mechanisms that are calculated at the end of a test run or a monitor run. These can be used to look at metrics and determine if a test passed or failed based on user defined thresholds.

Forced warnings and failures

You can explicitly force failure or warning in the probe or the whole test.

  • .rtcWarning() – add a warning to the probe’s status with a specific warning message
  • .rtcFail() – fail the probe in the test with a specific error message
  • .rtcFailAll() – fail the probe and attempt to stop the test by failing all probes in the test with a specific error message

Nightwatch assertions

Nightwatch scripting language has its own assertion mechanisms that can be used in testRTC. Our suggestion is to try and use the above primitives instead where possible.

Was this article helpful?

Related Articles