# Page Objects (Humand Pattern)

Humand uses page objects as the main boundary between tests and UI details.

## Core rules

- Locators live in page objects.
- Tests call page object actions, not raw `page.click()` chains.
- Page objects include reusable `expect*` helpers for repeated page-state checks.
- Keep methods behavior-oriented (`createNewCycle`, `switchToConfigTab`, etc.).

## Class structure

- Extend local `pages/BasePage.ts` for shared helpers.
- Define readonly locators in constructor.
- Provide:
  - action methods
  - navigation methods (`goto`)
  - `expect*` helper methods

## Assertions policy

Humand convention allows page-level assertion helpers when they represent reusable page-state checks.

Examples:

- `expectPageLoaded()`
- `expectCycleInTable(name)`
- `expectSnackbar(text)` (base helper)

Scenario-specific assertions still belong in tests.

## When to split objects

- Split when a page object exceeds a clear domain boundary.
- Use component objects for reusable UI regions (future: modal/drawer/table components).

## Anti-patterns

- exposing raw locators to test files as public API
- mixing unrelated domains into one giant page class
- hiding business assertions so deeply that test intent is unclear
