$npx -y skills add anhtester/codex-testing-kit --skill framework-architectSkill thiết kế và scaffold automation framework hoàn chỉnh cho Playwright, Selenium, và Appium — bao gồm project structure, base classes, config management, reporting, và CI/CD integration.
| 1 | # Framework Architect |
| 2 | |
| 3 | ## Description |
| 4 | |
| 5 | Skill chuyên biệt giúp agent thiết kế, scaffold và triển khai automation framework từ đầu. Hỗ trợ đa nền tảng (Web, Mobile, API) với các framework phổ biến nhất. |
| 6 | |
| 7 | Agent có thể: |
| 8 | |
| 9 | - Thiết kế project structure theo best practices |
| 10 | - Sinh base classes, config management, driver/browser management |
| 11 | - Tích hợp reporting (Allure, HTML Report, Playwright Report) |
| 12 | - Cấu hình CI/CD pipeline (GitHub Actions, GitLab CI, Jenkins) |
| 13 | - Sinh template Page Object Model, fixtures, helpers |
| 14 | - Tạo file cấu hình (package.json, pom.xml, build.gradle, playwright.config.ts) |
| 15 | |
| 16 | --- |
| 17 | |
| 18 | ## When to Use |
| 19 | |
| 20 | Sử dụng skill này khi: |
| 21 | |
| 22 | - User yêu cầu tạo/thiết kế automation framework mới |
| 23 | - User cần scaffold project structure cho test automation |
| 24 | - User muốn chuẩn hóa framework hiện tại |
| 25 | - User cần tích hợp reporting hoặc CI/CD vào framework |
| 26 | - User hỏi về best practices cho framework design |
| 27 | |
| 28 | Trigger keywords: "create framework", "design framework", "scaffold project", "thiết kế framework", "tạo project mới" |
| 29 | |
| 30 | --- |
| 31 | |
| 32 | ## Supported Stacks |
| 33 | |
| 34 | ### 🌐 Web Automation |
| 35 | |
| 36 | | Stack | Ngôn ngữ | Runner | Report | Build Tool | |
| 37 | |---|---|---|---|---| |
| 38 | | **Playwright + TypeScript** | TypeScript | Playwright Test | HTML Report, Allure | npm | |
| 39 | | **Playwright + Java** | Java | TestNG / JUnit5 | Allure Report | Maven / Gradle | |
| 40 | | **Playwright + Python** | Python | Pytest | Allure, pytest-html | pip | |
| 41 | | **Selenium + Java** | Java | TestNG | Allure, ExtentReports | Maven / Gradle | |
| 42 | | **Selenium + Python** | Python | Pytest | Allure, pytest-html | pip | |
| 43 | |
| 44 | ### 📱 Mobile Automation |
| 45 | |
| 46 | | Stack | Ngôn ngữ | Runner | Report | Build Tool | |
| 47 | |---|---|---|---|---| |
| 48 | | **Appium + Java** | Java | TestNG | Allure, ExtentReports | Maven / Gradle | |
| 49 | | **Appium + Python** | Python | Pytest | Allure, pytest-html | pip | |
| 50 | |
| 51 | ### 🔌 API Automation |
| 52 | |
| 53 | | Stack | Ngôn ngữ | Runner | Report | |
| 54 | |---|---|---|---| |
| 55 | | **REST Assured** | Java | TestNG | Allure | |
| 56 | | **Playwright API** | TypeScript | Playwright Test | HTML Report | |
| 57 | | **Requests + Pytest** | Python | Pytest | Allure | |
| 58 | |
| 59 | --- |
| 60 | |
| 61 | ## Framework Components |
| 62 | |
| 63 | Mỗi framework PHẢI bao gồm các thành phần sau (tùy chỉnh theo stack): |
| 64 | |
| 65 | ### 1. Project Structure (Mandatory) |
| 66 | - Cấu trúc thư mục rõ ràng, phân tách pages/tests/utils/config |
| 67 | - File README.md hướng dẫn setup + chạy test |
| 68 | - File .gitignore phù hợp |
| 69 | |
| 70 | ### 2. Configuration Management (Mandatory) |
| 71 | - Quản lý environment (dev/staging/prod) qua config file hoặc .env |
| 72 | - Centralized config — không hardcode giá trị trong test |
| 73 | - Sensitive data (credentials) qua environment variables, KHÔNG commit vào repo |
| 74 | |
| 75 | ### 3. Browser / Driver Management (Mandatory) |
| 76 | - **Playwright:** playwright.config.ts / conftest.py với browser setup |
| 77 | - **Selenium:** WebDriverManager hoặc Driver Factory pattern |
| 78 | - **Appium:** Desired Capabilities factory, Appium server config |
| 79 | |
| 80 | ### 4. Base Classes (Mandatory) |
| 81 | - Base Page — chứa common methods (wait, click, type, screenshot) |
| 82 | - Base Test — chứa setup/teardown, test lifecycle hooks |
| 83 | - Không hardcode waits — chỉ dùng smart waits |
| 84 | |
| 85 | ### 5. Page Object Model (Mandatory) |
| 86 | - Mỗi page/screen → 1 Page class |
| 87 | - Locators khai báo ở đầu class, không inline trong test |
| 88 | - Methods mô tả hành vi người dùng (không phải thao tác DOM) |
| 89 | |
| 90 | ### 6. Test Data Management (Mandatory) |
| 91 | - Data factory / builder pattern cho test data |
| 92 | - Data external (JSON/YAML/CSV) cho data-driven tests |
| 93 | - Data unique + traceable (timestamp/random prefix) |
| 94 | |
| 95 | ### 7. Utilities (Mandatory) |
| 96 | - Wait helpers (smart waits, custom conditions) |
| 97 | - Screenshot utilities (capture on failure) |
| 98 | - Logger (structured logging, không dùng print/console.log) |
| 99 | - Date/Time helpers, String generators |
| 100 | |
| 101 | ### 8. Reporting (Mandatory) |
| 102 | - Tích hợp ít nhất 1 reporting tool |
| 103 | - Screenshot attach on failure |
| 104 | - Test execution summary (pass/fail/skip counts) |
| 105 | |
| 106 | ### 9. CI/CD Pipeline (Optional — nhưng khuyến khích) |
| 107 | - GitHub Actions / GitLab CI / Jenkins pipeline template |
| 108 | - Parallel execution config |
| 109 | - Artifact upload (reports, screenshots) |
| 110 | |
| 111 | --- |
| 112 | |
| 113 | ## Project Structure Templates |
| 114 | |
| 115 | ### Playwright + TypeScript |
| 116 | |
| 117 | ``` |
| 118 | project-root/ |
| 119 | ├── playwright.config.ts # Playwright configuration |
| 120 | ├── package.json # Dependencies + scripts |
| 121 | ├── .env.example # Environment template |
| 122 | ├── .gitignore |
| 123 | ├── README.md |
| 124 | ├── src/ |
| 125 | │ ├── pages/ # Page Object classes |
| 126 | │ │ ├── base.page.ts # Base page (common methods) |
| 127 | │ │ ├── login.page.ts |
| 128 | │ │ └── dashboard.page.ts |
| 129 | │ ├── fixtures/ # Custom fixtures |
| 130 | │ │ ├── auth.fixture.ts # Authentication fixture |
| 131 | │ │ └── base.fixture.ts # Extended test with all fixtures |
| 132 | │ ├── utils/ # Helpers & utilities |
| 133 | │ │ ├── test-data.ts # Data generators |
| 134 | │ │ ├── env.config.ts # Environment config reader |
| 135 | │ │ └── helpers.ts |