|
| 1 | +# K11TechLab Playwright Automation Framework |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +K11TechLab is a robust, real-world Playwright automation framework designed for modern SaaS web applications. It demonstrates best practices in UI automation, advanced reporting, artifact management, and API testing, supporting both E2E and component-level testing for React applications. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Key Features |
| 10 | + |
| 11 | +- **Page Object Model (POM):** Clean abstraction for UI automation. |
| 12 | +- **Component Testing:** Playwright CT for React components (QuickActions, Card, HeroCarousel). |
| 13 | +- **E2E Flows:** Advanced user journeys, data-driven and smoke test flows. |
| 14 | +- **API Testing:** Built-in Playwright APIRequestContext, with response artifact saving. |
| 15 | +- **Visual Regression:** Automated screenshot comparison for UI/components. |
| 16 | +- **Custom Fixtures & Hooks:** Screenshots, video capture, and advanced reporting (Allure, HTML). |
| 17 | +- **Network Mocking:** Request interception for robust test scenarios. |
| 18 | +- **CI/CD Friendly:** Scalable structure, easy integration. |
| 19 | +- **Documentation:** In-code comments, README, and /doc articles. |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Project Structure |
| 24 | + |
| 25 | +``` |
| 26 | +K11TechLab-playwright-javascript-ai-augmented-framework/ |
| 27 | +│ |
| 28 | +├── artifacts/ # Locator maps, screenshots, test artifacts |
| 29 | +├── components/ # React UI components |
| 30 | +├── hooks/ # Test hooks (before/after logic) |
| 31 | +├── pages/ # Page Object Model (POM) classes |
| 32 | +├── tests/ # Test specs (smoke, regression, component, API) |
| 33 | +├── utils/ # Utilities (actions, waits, data, etc.) |
| 34 | +├── apiresponse/ # Saved API responses (JSON) |
| 35 | +├── doc/ # Documentation articles |
| 36 | +├── playwright.config.js # Playwright config |
| 37 | +├── playwright-ct.config.js # Playwright CT config |
| 38 | +├── package.json # Project dependencies |
| 39 | +└── README.md |
| 40 | +``` |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +## Test Types Supported |
| 45 | + |
| 46 | +- **E2E UI Tests:** Full user journeys, navigation, forms, business logic |
| 47 | +- **Component Tests:** Isolated React component validation (CT) |
| 48 | +- **API Tests:** REST endpoint validation, chaining with UI flows |
| 49 | +- **Visual Regression:** Screenshot comparison for UI/components |
| 50 | +- **Data-driven & Smoke Tests:** Fast feedback for critical flows |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +## Artifacts & Reporting |
| 55 | + |
| 56 | +- **Screenshots:** For every test and individual card/component |
| 57 | +- **Videos:** For selected tests |
| 58 | +- **Allure & HTML Reports:** Rich test evidence |
| 59 | +- **API Responses:** Saved as JSON for traceability |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## Best Practices |
| 64 | + |
| 65 | +- No hard-coded waits (auto-waiting) |
| 66 | +- Assertions in tests, not page objects |
| 67 | +- Reusable logic in utilities |
| 68 | +- Realistic user flows |
| 69 | +- Scalable, maintainable structure |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | +## How to Run |
| 74 | + |
| 75 | +1. Install dependencies: |
| 76 | + ```bash |
| 77 | + npm install |
| 78 | + ``` |
| 79 | +2. Run all tests: |
| 80 | + ```bash |
| 81 | + npx playwright test |
| 82 | + ``` |
| 83 | +3. Run component tests: |
| 84 | + ```bash |
| 85 | + npx playwright test -c playwright-ct.config.js |
| 86 | + ``` |
| 87 | +4. Run API tests: |
| 88 | + ```bash |
| 89 | + npx playwright test tests/api/JSONPlaceholderAPITests.spec.js |
| 90 | + ``` |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +## Extending the Framework |
| 95 | + |
| 96 | +- Add new page objects in `/pages` |
| 97 | +- Add new components in `/components` |
| 98 | +- Add new tests in `/tests` |
| 99 | +- Add utilities in `/utils` |
| 100 | +- Update documentation in `/doc` and `README.md` |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## Authors & Contact |
| 105 | + |
| 106 | +- Maintained by K11 Tech QA Team |
| 107 | +- For support: k11softwaresolutions@gmail.com |
| 108 | +- Website: https://k11softwaresolutions.com |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +*See README.md and other /doc articles for more details and advanced usage.* |
0 commit comments