generate-automation-framework
Skill28 starsChanged 4 months agoMITView on GitHub
Thiết kế và scaffold automation framework hoàn chỉnh. Hỗ trợ Playwright, Selenium, Appium — Web, Mobile, API.
- Reads credentials
- Installs packages
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- analyze-flaky-testsSkill
- analyze-requirement-documentSkill
- fetch-jira-requirementsSkill
- flaky-test-analyzerSkill
- framework-architectSkill
- generate-api-tests-from-swaggerSkill
- generate-application-test-planSkill
- generate-automation-from-testcasesSkill
- generate-automation-from-ui-flowSkill
- generate-combinatorial-test-dataSkill
- generate-cross-module-test-planSkill
- generate-locatorSkill
- generate-manual-testcases-rbtSkill
- generate-requirements-from-websiteSkill
- generate-testcases-from-requirementsSkill
- generate-test-dataSkill
- import-test-results-xraySkill
- jira-integrationSkill
- locator-healer-agentSkill
- qa-automation-engineerSkill
- rbt-manual-testingSkill
- requirements-analyzerSkill
- smart-locator-agentSkill
- test-data-generatorSkill
- ui-debug-agentSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 144
Test lifecycle hooks (beforeAll, afterAll, beforeEach, afterEach)
- Distinctive: line 168
Test data dùng TestDataGenerator (nếu applicable)
- Distinctive: line 186
Test step logging trong report
- Distinctive: line 197
Run tests (headless mode cho CI)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Workflow: Thiết Kế Automation Framework
BẮT BUỘC (MANDATORY SKILL): Bạn PHẢI nạp và đọc kỹ nội dung của skill
$framework-architect(tại.agents/skills/framework-architect/SKILL.md) trước khi bắt đầu. Ngoài ra, tham khảo thêm skill$qa-automation-engineerđể nắm các quy tắc automation chung.
Workflow này giúp agent thiết kế, scaffold và triển khai một automation framework hoàn chỉnh từ đầu, phù hợp với nhu cầu cụ thể của project.
⚠️ Nguyên tắc thực thi
- Tất cả output bằng Tiếng Việt
- KHÔNG đoán tech stack — phải hỏi user xác nhận trước khi scaffold
- PHẢI tạo artifact
task.mdđể theo dõi tiến độ - Mỗi file sinh ra phải biên dịch/chạy được ngay — không để placeholder
// TODO - Framework phải tuân thủ design principles trong skill
$framework-architect
Stacks hỗ trợ
| Platform | Stack | Ngôn ngữ | Runner | Report |
| 🌐 Web | Playwright | TypeScript | Playwright Test | HTML Report, Allure |
| 🌐 Web | Playwright | Java | TestNG / JUnit5 | Allure |
| 🌐 Web | Playwright | Python | Pytest | pytest-html, Allure |
| 🌐 Web | Selenium | Java | TestNG | Allure, ExtentReports |
| 🌐 Web | Selenium | Python | Pytest | pytest-html, Allure |
| 📱 Mobile | Appium | Java | TestNG | Allure, ExtentReports |
| 📱 Mobile | Appium | Python | Pytest | Allure |
| 🔌 API | REST Assured | Java | TestNG | Allure |
| 🔌 API | Playwright API | TypeScript | Playwright Test | HTML Report |
Các bước thực hiện
Bước 1: Thu thập yêu cầu (Requirements Gathering — ⏸️ CHECKPOINT)
Hỏi user các thông tin cần thiết:
Câu hỏi Mục đích Mặc định nếu không trả lời Ứng dụng cần test là gì? (Web / Mobile / API / Hybrid) Chọn platform Web Framework nào? (Playwright / Selenium / Appium) Chọn tool Playwright Ngôn ngữ? (TypeScript / Java / Python) Chọn language TypeScript (Playwright), Java (Selenium/Appium) Project name? Đặt tên thư mục automation-frameworkCó cần CI/CD pipeline không? Sinh pipeline config Có (GitHub Actions) Reporting tool? Tích hợp report Mặc định theo stack Có test API song song không? Thêm API testing layer Không Parallel execution? Config parallel Không - Xác nhận lại với user trước khi scaffold:
📋 Tóm tắt framework sẽ tạo: - Platform: Web - Framework: Playwright - Language: TypeScript - Runner: Playwright Test - Report: HTML Report + Allure - CI/CD: GitHub Actions - Project name: my-automation Bạn xác nhận để tôi bắt đầu scaffold không? - Chờ user xác nhận trước khi sang Bước 2
Bước 2: Scaffold Project Structure (Foundation)
- Tạo artifact
task.mdđể theo dõi checklist:# Framework Setup Progress - [x] Bước 1: Thu thập yêu cầu - [ ] Bước 2: Scaffold project structure - [ ] Bước 3: Sinh base classes - [ ] Bước 4: Sinh example tests - [ ] Bước 5: Cấu hình reporting & CI/CD - [ ] Bước 6: Verify & Deliver - Tạo thư mục project theo template trong skill
$framework-architect:- Tham khảo mục Project Structure Templates trong SKILL.md
- Tạo toàn bộ thư mục + file cấu hình gốc
Sinh file cấu hình build (tuỳ stack):
Playwright + TypeScript:
package.json— dependencies:@playwright/test, devDependencies phù hợpplaywright.config.ts— baseURL, viewport (1920x1080), timeout, retries, reportertsconfig.json— paths, strict mode.env.example— template environment variables
Selenium + Java:
pom.xml— dependencies: selenium-java, testng, webdrivermanager, allure-testng, log4jtestng.xml— suite configuration, listenerslog4j2.xml— logging configuration
Appium + Java:
pom.xml— dependencies: appium-java-client, selenium-java, testng, alluretestng.xml— suite configuration- Capabilities config file (JSON/YAML) cho Android + iOS
Playwright + Python:
requirements.txt— playwright, pytest, pytest-playwright, allure-pytestpyproject.toml— pytest config, tool settingsconftest.py— root fixtures, browser setup
- Tạo file .gitignore phù hợp (node_modules, target, pycache, .env, reports...)
- Tạo README.md với hướng dẫn:
- Prerequisites (Node.js, Java, Python version)
- Installation steps
- Cách chạy test
- Project structure overview
- Conventions (naming, coding standards)
Bước 3: Sinh Core Classes (Base Layer)
Configuration Management:
Stack File Nội dung Playwright TS src/utils/env.config.tsĐọc .env, export typed config objectSelenium Java src/main/.../config/ConfigReader.javaĐọc properties file, singleton pattern Appium Java src/main/.../config/AppConfig.javaĐọc capabilities JSON, env variables Playwright Python src/utils/config.pyĐọc .envbằngpython-dotenvBrowser / Driver Management:
Stack File Nội dung Playwright TS playwright.config.ts+ fixturesBrowser config trong config, auth trong fixtures Selenium Java DriverFactory.javaFactory pattern, WebDriverManager, thread-safe Appium Java AppiumDriverFactory.java+CapabilitiesManager.javaAppium server URL, desired capabilities per device Playwright Python conftest.pyFixtures cho browser, context, page - Base Page / Screen class:
- Common methods:
navigate(),click(),type(),getText(),isVisible() - Built-in smart waits (KHÔNG có hard sleep)
- Screenshot on failure
- Logging mỗi action
- Common methods:
- Base Test class:
- Setup: khởi tạo browser/driver, navigate to baseURL
- Teardown: đóng browser/driver, capture screenshot nếu fail
- Test lifecycle hooks (beforeAll, afterAll, beforeEach, afterEach)
- Utilities:
TestDataGenerator— sinh email, username, phone unique + traceableWaitHelper— custom wait conditions (nếu cần ngoài built-in)ScreenshotUtil— capture + attach to reportLogger— structured logging (Log4j / winston / Python logging)
Bước 4: Sinh Example Tests (Validation Layer)
- Tạo ít nhất 1 example Page Object:
LoginPage(hoặcLoginScreencho mobile) với locators + methods thực tế- Locator dùng placeholder mô tả rõ cần thay thế:
// REPLACE: Update locator after inspecting actual DOM readonly usernameInput = this.page.getByLabel('Username'); readonly passwordInput = this.page.getByLabel('Password'); readonly loginButton = this.page.getByRole('button', { name: 'Login' });
- Tạo ít nhất 1 example Test:
LoginTest— demo happy path (login thành công)- Có đầy đủ: Arrange → Act → Assert
- Assertion có message rõ ràng
- Test data dùng TestDataGenerator (nếu applicable)
- Tạo 1 example data-driven test (nếu phù hợp):
- Đọc data từ file JSON/YAML/CSV
- Parameterized test với nhiều bộ data
Bước 5: Cấu hình Reporting & CI/CD (Integration Layer)
Reporting setup:
Stack Report Cấu hình Playwright TS HTML + Allure reportertrong playwright.config.tsSelenium Java Allure allure-testngdependency +@Step,@AttachmentannotationsAppium Java Allure + ExtentReports allure-testng+ExtentManagersingletonPlaywright Python pytest-html + Allure conftest.pyhooks + pytest addopts- Screenshot auto-attach on failure
- Test step logging trong report
CI/CD Pipeline (nếu user yêu cầu):
GitHub Actions template:
# Sinh file .github/workflows/<framework>.yml # Nội dung tùy stack: install deps → run tests → upload report- Install dependencies
- Run tests (headless mode cho CI)
- Upload test report as artifact
- Parallel execution (nếu được yêu cầu)
- Environment variables từ GitHub Secrets
- Docker support (optional — chỉ nếu user yêu cầu):
- Dockerfile cho test execution environment
- docker-compose.yml nếu cần Selenium Grid / Appium server
Bước 6: Verify & Deliver (Quality Gate)
- Kiểm tra framework build được:
# Playwright TS npm install && npx playwright install && npx playwright test --list # Selenium Java mvn clean compile # Appium Java mvn clean compile # Playwright Python pip install -r requirements.txt && playwright install - Chạy example test để verify framework hoạt động:
- Nếu PASS → framework sẵn sàng
- Nếu FAIL do thiếu app/URL → acceptable (ghi note trong README)
- Nếu FAIL do lỗi code framework → sửa ngay
- Review checklist trước khi bàn giao:
- Project structure đúng template
- Tất cả dependencies đã khai báo
- Config management hoạt động (đọc .env)
- Base Page/Test có đầy đủ common methods
- POM pattern được tuân thủ
- Smart waits — không có hard sleep
- Example test chạy được (hoặc chạy được khi có app)
- README.md hướng dẫn đầy đủ
- .gitignore bao phủ đúng
- Reporting tích hợp
- Không có debug log, commented code, TODO placeholder
- Cập nhật
task.mdvới trạng thái hoàn thành
Xử lý tình huống đặc biệt
| Tình huống | Cách xử lý |
| User muốn hybrid (Web + Mobile) | Tạo shared layer (utils, config) + tách pages vs screens |
| User muốn hybrid (Web + API) | Thêm API layer song song (api helpers + api tests folder) |
| User có framework cũ cần refactor | Đọc code hiện tại → đề xuất migration plan → refactor từng phần |
| User muốn multi-browser | Config parallel projects trong playwright.config.ts hoặc test suite XML |
| User muốn multi-device (Appium) | CapabilitiesManager hỗ trợ load từ JSON per device (Android/iOS) |
| User không biết chọn stack | Gợi ý dựa trên: team skill, project type, CI infra |
Output
- Project structure đầy đủ (tất cả thư mục + files)
- Build config (package.json / pom.xml / requirements.txt)
- Framework config (playwright.config.ts / testng.xml / conftest.py)
- Base classes (BasePage, BaseTest, DriverFactory, ConfigReader)
- Utilities (TestDataGenerator, WaitHelper, ScreenshotUtil, Logger)
- Example Page Object + Test (LoginPage + LoginTest)
- Reporting integration (Allure / HTML Report)
- CI/CD pipeline (GitHub Actions template)
- README.md (setup guide + project overview)
- Artifact
task.md(checklist tiến độ)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

