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 Multi Page Composition

From Leeroopedia
Revision as of 17:26, 16 February 2026 by Admin (talk | contribs) (Auto-imported from principles/Nightwatchjs_Nightwatch_Multi_Page_Composition.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Testing, Page_Object_Model, Test_Architecture
Last Updated 2026-02-12 00:00 GMT

Overview

A test composition pattern that chains multiple page objects together to model user journeys spanning several pages of a web application.

Description

Multi-Page Composition extends the Page Object Pattern to handle user flows that cross page boundaries. A single test may navigate from a search page to a results page, then to a detail page. Each page transition involves instantiating a new page object while the previous one becomes stale. This pattern enables testing complete user journeys (login → dashboard → settings → logout) while maintaining the encapsulation benefits of individual page objects.

Usage

Use multi-page composition when testing user flows that span multiple pages. Each page transition should instantiate the appropriate page object for the destination page.

Theoretical Basis

Multi-page composition follows a state machine model:

  1. State: Each page object represents the current page state
  2. Transition: User actions (click, submit) cause page transitions
  3. New state: A new page object is instantiated for the destination
  4. Verification: Assertions are made on the new page's elements

Related Pages

Implemented By

Page Connections

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