How psalimath12/playwright-cura-test-automation works
Project Type and Purpose
• Type: An end-to-end test automation framework (an open-source tool)
• Purpose: Automate and validate key workflows (login, appointment booking, logout) in the Katalon CURA Healthcare Service demo, using Playwright and the Page Object Model (POM).
File Structure
• pages/
• Defines Page Object Model classes (AppointmentPage.js, AppointmentSummaryPage.js, LoginPage.js).
• tests/ & tests-examples/
• tests/ contains suite-specific test specs (e.g., loginTest.spec.js).
• tests-examples/ shows demonstration specs (e.g., demo-todo-app.spec.js).
• playwright.config.js
• Configuration for browser projects (chromium, firefox, webkit), trace settings, reporters.
• package.json / package-lock.json
• Lists dependencies (playwright) and NPM scripts to run tests and reports.
README for Insights
• POM pattern for maintainability.
• Cross-browser support and HTML reporting.
• Debugging with Playwright Inspector and Trace Viewer.
Main Components & Relationships
a. Test Runner & CLI (npx playwright test)
b. Configuration (playwright.config.js, package.json scripts)
c. Test Suites (tests/*.spec.js)
d. Page Object Layer (pages/*.js)
e. Playwright Engine (browser drivers: Chromium, Firefox, WebKit)
f. System Under Test (remote Katalon CURA web application)
g. Reporting & Trace Module (HTML report generator, trace viewer)
Interaction Flow:
• Test Runner loads Config →
• Instantiates Browser Instances via Playwright Engine →
• Tests invoke Page Objects →
• Page Objects send browser commands (click, fill, navigate) to the CURA app →
• Browser Engine executes actions and returns responses →
• Test Runner captures results, errors, and optional trace →
• Reporting Module generates HTML reports & traces.
Architectural Patterns & Principles
• Page Object Model (Separation of concerns: UI selectors & actions in pages/, test logic in tests/)
• Configuration-driven cross-browser execution
• Modular, pluggable reporting & tracing
• NPM script orchestration for standardized CLI entry points