Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Nightwatchjs Nightwatch Extension Usage In Tests

From Leeroopedia
Knowledge Sources
Domains Testing, Extensibility
Last Updated 2026-02-12 00:00 GMT

Overview

A test integration pattern for invoking registered custom commands and assertions alongside built-in API methods.

Description

Extension Usage in Tests describes how custom commands and assertions are consumed in test code. Custom commands are called on the browser object exactly like built-in commands, making them first-class API members. Custom assertions are invoked via browser.assert.assertionName() or browser.verify.assertionName(). The seamless integration means tests do not need to import or require custom extensions; they are available immediately after configuration.

Usage

Use custom commands and assertions in tests the same way you use built-in ones. No import statements are needed.

Theoretical Basis

The extension integration principle follows the uniform API pattern:

  1. Custom commands are indistinguishable from built-in commands at the call site
  2. Custom assertions appear on both assert (strict) and verify (lenient) namespaces
  3. Method signatures are defined by the extension author
  4. Chaining works identically to built-in commands

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment