Skip to content

tahuuducknowleadge/robot-ai-devops-framework

Repository files navigation

🤖 Robot AI DevOps Testing Framework

Framework kiểm thử chức năng hướng dữ liệu (data-driven) sử dụng Robot Framework, hỗ trợ tích hợp AI và DevOps (CI/CD) dành cho ứng dụng web.

🚀 Mục Tiêu

✅ Tự động hoá kiểm thử chức năng website bằng Robot Framework ✅ Tách riêng dữ liệu test (Excel, JSON...) ra khỏi logic test ✅ Tích hợp công cụ AI: Faker, OpenCV, Tesseract, ChatGPT API (tuỳ chọn) ✅ Tích hợp DevOps: GitHub Actions hoặc Jenkins ✅ Cấu trúc rõ ràng, dễ mở rộng

📁 Cấu Trúc Thư Mục

robot-ai-devops-framework/
├── testsuites/ - Test case theo chức năng (VD: login.robot)
├── resources/ - Các bước dùng chung (login_steps.robot, ...)
├── keywords/ - Keyword Python mở rộng nếu cần
├── data/ - Dữ liệu test: Excel, JSON, CSV
├── ai/ - Tích hợp AI: sinh dữ liệu, kiểm UI, OCR
├── reports/ - Báo cáo test HTML
├── ci_cd/ - Pipeline CI/CD: GitHub Actions hoặc Jenkins
├── requirements.txt - Thư viện cần thiết
└── README.md - Tài liệu dự án

⚙️ Công Nghệ Sử Dụng

Framework: Robot Framework
WebDriver: SeleniumLibrary
Dữ liệu test: JSON / Excel / CSV (openpyxl) Báo cáo: Robot Report, Allure (nâng cao)
Sinh dữ liệu: Faker (pip3 install faker) AI hỗ trợ: ChatGPT, OpenCV, Tesseract
CI/CD: GitHub Actions / Jenkins

📌 Cài Đặt

python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
robotframework
robotframework-seleniumlibrary
robotframework-jsonlibrary
robotframework openpyxl

## Cài phiên bản ổn định
pip install robotframework==6.0.2

## Cài thêm thư viện hỗ trợ
pip install allure-pytest

## Thêm biến môi trường này để debug
SET ROBOT_SYSLOG_FILE=log_robot_listener.txt


## ▶️ Chạy Test  
robot testsuites/login.robot          # Chạy 1 file
robot testsuites/                     # Chạy tất cả
robot --outputdir reports testsuites/ # Ghi log vào thư mục reports
robot --listener "allure_robotframework;output/allure-results" --outputdir reports testsuites/ # Lưu kết quả Allure vào thư mục reports

## Chạy để tạo file .robot
python generate_robot_tests.py

## 🔍 Báo Cáo  
Sau khi test xong, mở `reports/log.html` hoặc `reports/report.html` để xem kết quả chi tiết.  
allure generate output/allure-results -o output/allure --clean

## 🔍 Mở Báo Cáo Allure  
allure open output/allure

## 🤖 Tính Năng AI  
Faker: tạo email, tên, địa chỉ ngẫu nhiên
OpenCV: so sánh ảnh giao diện để phát hiện thay đổi
Tesseract: OCR popup hoặc UI không truy cập được qua DOM
ChatGPT: sinh test case từ user story (tùy chọn nâng cao)

## 🔄 CI/CD  
- Tự động chạy test khi push code (GitHub Actions) 
- Cài dependencies → Run tests → Tạo report → Gửi thông báo Email

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages