How inderbir001/practicesoftwaretesting works
This is not an application you deploy; it’s a Playwright + TypeScript end-to-end (E2E) test automation framework targeting the external site https://practicesoftwaretesting.com/.
The architecture you want to capture is therefore:
• How tests are organized and executed (Playwright runner, projects/browsers, config)
• How tests interact with the AUT (Application Under Test) via Page Object Model (POM)
• How reporting/artifacts work (HTML report, screenshots/videos on failure)
• How the custom AI reporter integrates with Ollama to analyze failures
• How CI runs the same pipeline in GitHub Actions
So your “system” is the test harness + its integrations, not the website being tested (treat the website as an external dependency).
File structure analysis → map folders to components
From the tree:
Core framework / shared abstractions
• base/basePage.ts
Likely provides shared page functionality (navigation, waits, common selectors, helpers). This is the base layer of the POM.
Page Objects (POM layer)
• pages/**
Represents screen/page abstractions and flows:
• pages/homePage.ts, pages/contactPage.ts
• pages/Catagories/* (hand tools, power tools, rentals, etc.)
• pages/sign_In_Page/* (register, forgot password, sign in)
Tests (specs)
• tests/Sign In/*.spec.ts
AI failure analysis integration
• ai/aiReporter.ts
Custom Playwright reporter implementation.
• ai/ollama.ts
Client wrapper to call local Ollama HTTP API (likely).
This is a major architectural differentiator; show it prominently as an optional path gated by env var.
Configuration / orchestration
• playwright.config.ts
Defines projects (Chromium/Firefox/WebKit), reporters, artifacts, timeouts, etc.
• package.json, package-lock.json
Execution scripts/dependencies (Playwright, dotenv, faker, etc.)
• .github/workflows/playwright.yml
The pipeline that installs deps/browsers and runs npx playwright test.
README insights to encode
Key behaviors called out explicitly:
• Cross-browser execution (Chromium, Firefox, WebKit) → model as “runner spawns projects”
• Artifacts on failure: HTML report, screenshots, videos
• AI Reporter:
• Triggered on failure
• Collects error + stack trace
• Sends to local Ollama instance
• Prints analysis + suggested fix to console
• Controlled via .env variable AI_ENABLED=true (dotenv)
Developer / CI Trigger
• Developer runs locally (npx playwright test)
• GitHub Actions triggers on push/PR
Playwright Test Runner
• Reads playwright.config.ts
• Loads reporters
• Creates browser projects
Browser Projects
• Chromium
• Firefox
• WebKit
(Optionally show as parallel lanes)
Test Specs
• tests/Sign In/*.spec.ts (and future suites)
• These import and orchestrate Page Objects
Page Object Model (POM) Layer
• pages/**
• Depends on base/basePage.ts
Application Under Test (External)
• https://practicesoftwaretesting.com/
• As an external system boundary
Reporting & Artifacts
• HTML report (playwright-report)
• Screenshots/videos/traces (if enabled in config)
AI Failure Analysis (Optional)
• ai/aiReporter.ts (reporter)
• ai/ollama.ts (client)
• Ollama Local Service (external process on localhost)
• Model qwen2.5-coder:7b
Environment Configuration
• .env via dotenv
• AI_ENABLED toggles AI path
GitHub Actions Workflow
• .github/workflows/playwright.yml
• Installs Node deps, installs Playwright browsers, runs tests, uploads artifacts (if configured)
Execution flow
• Developer/CI → npx playwright test → Playwright Test Runner
• Runner → loads playwright.config.ts → spawns Browser Projects
• Runner → executes Test Specs → calls Page Objects → uses BasePage helpers
• Browser Projects ↔ AUT (HTTP interactions via browser automation)
Failure/reporting flow
• Runner → Reporters
• On failure: Runner → Artifact capture (screenshots/video/trace) → saved to report output
• On failure (conditional): Runner → aiReporter.ts
• aiReporter.ts → prompt w/ error + stack trace → ollama.ts
• ollama.ts → Ollama service (localhost) → returns analysis
• aiReporter.ts → prints analysis to console (and/or attaches to report, if implemented)
Configuration gating
• .env/dotenv → controls whether AI reporter is active (AI_ENABLED=true)
Architectural patterns / design principles
• Page Object Model: tests are thin; selectors/actions live in pages/**
• Shared base class: BasePage centralizes common behavior
• Pluggable reporting: Playwright reporters + custom AI reporter
• Environment-driven behavior: AI analysis toggled via env var
• CI parity: same command locally and in GitHub Actions
• Playwright Test Runner (Node.js)
• TypeScript
• dotenv
• GitHub Actions
• Ollama + model name
Suggested “best possible” component breakdown (don’t overthink; split more)
• tests/Sign In/* as a “Sign-In Test Suite”
• pages/sign_In_Page/* as “Auth POM”
• pages/Catagories/* as “Catalog POM”
• base/basePage.ts as “POM Base Utilities”
• ai/aiReporter.ts as “Custom Reporter: Failure Analyzer”
• ai/ollama.ts as “Ollama Client Adapter”
• playwright.config.ts as “Execution/Projects/Reporters Config”
• .github/workflows/playwright.yml as “CI Job: install → test”
That level of separation is ideal for accuracy and future maintenance.