ngx-page-object-model

Enforce Page Object Model guidelines for Angular component tests.

436|181|Updated Jun 9, 2019
One-click install
npx skills add https://github.com/azerothcore/Keira3 --skill ngx-page-object-model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ngx-page-object-model
Source: https://github.com/azerothcore/Keira3/tree/main/.agents/skills/ngx-page-object-model
Command: npx skills add https://github.com/azerothcore/Keira3 --skill ngx-page-object-model

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Centralizes and enforces the Page Object Model approach for Angular component tests, ensuring tests interact with the rendered DOM (the public contract) rather than reaching into component internals.

Core Features & Use Cases

  • Enforce the Page Object Model (POM) pattern across Angular component unit tests to improve test reliability and readability.
  • Promote DOM-driven testing, where tests interact with the UI through page objects and public inputs/outputs rather than internal implementation details.
  • Provide guidelines for structuring tests, including avoiding private state access and using DOM-based selectors to verify behavior.

Quick Start

Follow the canonical POM test structure to start implementing page-object-driven Angular component tests.

Frequently Asked Questions about ngx-page-object-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce the Page Object Model pattern in Angular component tests?

The Page Object Model (POM) in Angular testing centralizes DOM-driven interactions, ensuring tests interact with the rendered UI through public inputs and outputs rather than reaching into component internals, which improves test reliability and readability.

Why should Angular unit tests interact with the DOM instead of component internals?

Angular unit tests should interact with the DOM because accessing private component internals creates brittle tests. By using DOM-based selectors and page objects, tests verify behavior through the public contract, improving reliability and readability across project updates.

What is the best way to structure Angular component tests using page objects?

The best way to structure Angular component tests using page objects is to follow the canonical POM test structure. This involves avoiding private state access and using DOM-based selectors to verify component behavior through the public UI contract.

Can I use the Page Object Model pattern for Angular tests across different projects?

Yes, you can apply the Page Object Model pattern for Angular tests across different projects. The central guidelines enforce safe testing practices by forbidding internals access and promoting DOM-based interactions universally across your Angular testing suite.

What are the forbidden patterns when implementing page object driven Angular tests?

Forbidden patterns in page object driven Angular tests include accessing private component state and bypassing the DOM. Tests must strictly avoid reaching into component internals and instead verify behavior through public inputs, outputs, and DOM-based selectors.