You can now use the standard Node.js
require() syntax to import code snippets into your Browser checks, where we first only supported Handlebars templates.
Here's an example:
- Create a login routine you want to reuse in Browser check scripts. Export it as a
requirethe snippet from the
./snippetsdirectory — just like JS file — and call the function passing in the relevant parameters.
This is now the recommended way to DRY up your code. The legacy Handlebars notations is still usable till further notice.