Dự án kiểm thử tự động E2E sử dụng CodeceptJS + AI (Azure OpenAI / Google Gemini).
- ✅ Tích hợp AI để tạo test data động (email, password, phone...)
- ✅ Phân tích UI tự động và đề xuất test case
- ✅ Kiểm thử đăng nhập với nhiều kịch bản
- ✅ Báo cáo đẹp với Allure Report
- ✅ Hỗ trợ Azure OpenAI và Google Gemini
git clone https://github.com/nhana123/Codecept_JS_AI_testing.git
cd Codecept_JS_AI_testing
npm installTạo file .env:
Azure OpenAI:
AI_PROVIDER=azure
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com
AZURE_OPENAI_KEY=your-api-key
AZURE_OPENAI_DEPLOYMENT=your-deployment-name
AZURE_OPENAI_API_VERSION=2023-05-15Google Gemini:
AI_PROVIDER=gemini
GEMINI_API_KEY=your-gemini-api-key
GEMINI_MODEL=gemini-pro├── codecept.conf.js # Cấu hình CodeceptJS + AI
├── helpers/AIHelper.js # AI Helper methods
├── pages/LoginPage.js # Page Object Model
├── tests/ # Test cases
│ ├── login_test.js
│ ├── ai_helper_test.js
│ └── gemini_demo_test.js
└── output/ # Test results & reports
# Chạy tất cả tests
npx codeceptjs run --plugins allure
# Chạy test cụ thể
npx codeceptjs run tests/login_test.js --plugins allure
# Xem báo cáo
npx allure serve outputconst { I } = inject();
Scenario('Test với AI', async ({ I }) => {
// Hỏi AI
const answer = await I.askAI('Test automation là gì?');
// Tạo test data
const emails = await I.generateTestData('email', 5, false);
// Phân tích UI
const analysis = await I.analyzeUI();
// Giải thích lỗi
const help = await I.explainError('Element not found');
});askAI(question)- Hỏi AI bất kỳ câu hỏi nàogenerateTestData(type, count, valid)- Tạo test dataanalyzeUI()- Phân tích giao diệnexplainError(error)- Giải thích lỗisuggestAssertions(context)- Gợi ý assertions
📖 Chi tiết: AI_USAGE_GUIDE.md
login_test.js- Kiểm thử đăng nhập cơ bảnfilless_login_test.js- Kiểm thử validation emailai_helper_test.js- Demo AI Helpergemini_demo_test.js- Demo Gemini AIai_ridervolt_test.js- Test tích hợp RiderVolt
MIT License
Happy Testing! 🚀