📋 محتويات الصفحة
📖 الوصف
Nightwatch.js هو إطار اختبار End-to-End متكامل مكتوب بـ Node.js لاختبار تطبيقات الويب والمواقع. يستخدم Nightwatch.js Selenium WebDriver للتحكم في المتصفحات الحقيقية. يدعم Nightwatch.js: Testing API، Parallel execution، CI Integration، و Test Runner مدمج. يوفر أيضاً Page Object Pattern لبناء اختبارا...
🎯 يستخدم في
مجالات استخدام هذه الأداة
•
End-to-End Testing
•
Functional Testing
•
UI Testing
•
Cross-browser Testing
•
API Testing
✨ المميزات
أبرز مميزات هذه الأداة
✓
Easy Selenium WebDriver
✓
easy Parallel Execution
✓
easy Page Objects
✓
easy Built-in Runner
✓
easy CI Integration
✓
easy Easy Setup
✓
easy TypeScript
⚠️ العيوب
نقاط يجب مراعاتها
×
بطيء
×
يحتاج Selenium Server
×
قد يكون معقداً
×
Limited في الميزات الحديثة
💻 مثال على الاستخدام
كيفية استخدام هذه الأداة
// tests/login.js
module.exports = {
'Login with valid credentials': async function(browser) {
browser
.url('http://localhost:3000/login')
.waitForElementVisible('form')
.setValue('input[name="email"]', 'john@example.com')
.setValue('input[name="password"]', 'password123')
.click('button[type="submit"]')
.waitForElementVisible('.success-message')
.assert.containsText('.success-message', 'Welcome')
.end()
},
'Login with invalid credentials': async function(browser) {
await browser.url('http://localhost:3000/login')
await browser.setValue('input[name="email"]', 'invalid@example.com')
await browser.setValue('input[name="password"]', 'wrong')
await browser.click('button[type="submit"]')
await browser.waitForElementVisible('.error-message')
await browser.assert.containsText('.error-message', 'Invalid credentials')
}
}
📚 أدوات أخرى في Testing
قد يعجبك أيضاً