Support & information center

How to use Nightwatch Testing Library with testRTC?

Also known as NWTL, the Nightwatch Testing Library is a powerful utility library for Nightwatch that makes figuring out and finding the elements in your UI that needs to be clicked, filled or waited upon clearer and cleaner. As this library states, it offers “simple and complete custom queries for Nightwatch that encourage good testing practices”.

We’ve see an good number of our clients interested in this, so we added support for it as part of our scripting capabilities.

In order to use this library in your test scripts, add the following statements at the beginning of your test script:

const { getQueriesFrom } = require("@testing-library/nightwatch");Code language: JavaScript (javascript)

This will load the NWTL as part of your script and enable you to use its capabilities.

Here’s a comparison of how the Jitsi sample script would be written if we used NWTL in it:

Was this article helpful?

Related Articles