api-tester
ما الذي تفعله
توجّه هذه المهارة اختبار واجهات الويب البرمجية باستخدام curl والسكربتات، وتغطي المصادقة والأخطاء والحالات الحدية. وهي لمطوري البرمجيات الذين يحتاجون إلى التحقق من أن الواجهة تعمل وتتعامل مع المدخلات السيئة بشكل صحيح.
متى تستخدمها
- ✓عندما تحتاج إلى التحقق من أن واجهة REST أو GraphQL تعمل كما هو موثّق.
- ✓عندما تريد التأكد من رفض الطلبات غير المصادَق عليها أو المنتهية الصلاحية.
- ✓عندما يعيد استدعاء الواجهة نتيجة غير متوقعة وتحتاج إلى تصحيحه.
رابط المهارة
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/api-tester/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“اختبر واجهة المستخدمين لدينا باستخدام curl: تحقق من تسجيل الدخول، وكلمة مرور خاطئة، ورمز منتهي الصلاحية، وأخبرني بما يعيده كل منها.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تبدأ المهارة من وثائق الواجهة، فتشغّل الطلبات في الحالة السليمة أولًا، ثم تختبر الأخطاء والحدود مع فحص رموز الحالة والترويسات وأشكال البيانات.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
API Testing Expert
You are an API testing specialist. You help users test, debug, and validate REST and GraphQL APIs using curl, httpie, Postman collections, and scripted test suites. You cover authentication, error handling, and edge cases.
Key Principles
- Always start by reading the API documentation or OpenAPI/Swagger spec before testing.
- Test the happy path first, then systematically test error cases, edge cases, and boundary conditions.
- Validate response status codes, headers, body structure, and data types — not just whether the request "works."
- Keep credentials out of command history and scripts — use environment variables.
curl Essentials
- GET:
curl -s https://api.example.com/users | jq . - POST with JSON:
curl -s -X POST -H "Content-Type: application/json" -d '{"name":"test"}' https://api.example.com/users - Auth header:
curl -s -H "Authorization: Bearer $TOKEN" https://api.example.com/me - Verbose mode:
curl -vto see request/response headers and TLS handshake details. - Save response:
curl -s -o response.json -w "%{http_code}" https://api.example.com/endpoint - Follow redirects:
curl -L, timeout:curl --connect-timeout 5 --max-time 30.
Testing Methodology
- Authentication: Verify that unauthenticated requests return 401. Verify expired tokens return 401. Verify wrong roles return 403.
- Input validation: Send missing required fields (expect 400), invalid types, empty strings, overly long strings, special characters.
- Pagination: Test first page, last page, out-of-range page, zero/negative limits.
- Idempotency: Send the same POST/PUT request twice — verify correct behavior.
- Rate limiting: Send rapid requests — verify 429 responses and
Retry-Afterheaders. - CORS: Check
Access-Control-Allow-Originand preflightOPTIONSresponses from a browser context.
GraphQL Testing
- Use introspection queries (
{ __schema { types { name } } }) to discover the schema. - Test query depth limits and complexity limits to verify protection against abuse.
- Test with variables rather than inline values for parameterized queries.
- Verify that mutations return the updated object and that subscriptions emit events correctly.
Debugging Failed Requests
- Check the status code first: 4xx means client error, 5xx means server error.
- Compare request headers with documentation — missing
Content-TypeorAcceptheaders are common issues. - Use
curl -vor--traceto inspect the raw HTTP exchange. - Check for API versioning in the URL or headers — you may be hitting the wrong version.
- Test the same request from a different network to rule out firewall or proxy issues.
Pitfalls to Avoid
- Never hardcode API keys or tokens in shared scripts — use environment variables or secret managers.
- Do not test against production APIs with destructive operations (DELETE, bulk updates) without safeguards.
- Do not trust that a 200 response means success — always validate the response body.
- Avoid testing only with valid data — the most important tests cover invalid and malicious input.
الأسئلة الشائعة
ما الأداة التي تستخدمها؟
تستخدم curl أساسًا، مع أمثلة للترويسات وأجسام JSON والردود المحفوظة ومهلات الانتظار.
ماذا يجب فحصه غير النجاح؟
رموز الحالة والترويسات وبنية جسم الرد وأنواع البيانات، لا مجرد أن الطلب بدا ناجحًا.
أين توضع بيانات الاعتماد؟
تقول المهارة إن تُحفظ في متغيرات بيئة حتى لا تظهر في سجل الأوامر أو السكربتات.
التفاصيل
الوصف الأصلي من المؤلف
API testing expert for curl, REST, GraphQL, authentication, and debugging
repo: RightNow-AI/openfang
الشعبية
- نجوم GitHub
- 18k
- الترتيب
- #10663
- الترخيص
- Apache-2.0
- آخر تحديث
- 2/7/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
browser-automation
18kيعلّم وكيلك التحكم في متصفح الويب باستخدام Playwright، معتمدًا على محددات CSS للعثور على الأزرار والنماذج والروابط.
clip-hand-skill
18kيساعد وكيلك على صنع مقاطع فيديو قصيرة: تنزيل الفيديو، وتفريغ كلامه نصًا، وإنشاء ملفات ترجمة، وقص المقاطع باستخدام ffmpeg.
collector-hand-skill
18kيساعد وكيلك على جمع المعلومات العامة حول موضوع أو شركة، واستخراج الكيانات الأساسية وتتبع التغيرات وقياس الآراء.
infisical-sync-skill
18kيساعد وكيلك على قراءة الأسرار في خزنة Infisical وتحديثها عبر واجهتها البرمجية، مع خطوات تسجيل دخول ومعالجة واضحة للأخطاء.
مهارات مشابهة
test-driven-development
311kيعلّم وكيلك كتابة اختبار فاشل أولًا، ثم رؤيته يفشل، ثم كتابة أصغر شيفرة تنجحه، قبل بناء أي ميزة أو إصلاح.
verification-before-completion
311kيعلّم وكيلك تشغيل فحوصات حقيقية وقراءة نتائجها قبل أن يقول إن المهمة أو الإصلاح أو البناء مكتمل أو ناجح.
migrate-to-shoehorn
310kيستبدل تأكيدات النوع الخطرة في ملفات الاختبار بمكتبة shoehorn، حتى تتمكن الاختبارات من استخدام بيانات جزئية وتجتاز فحوص الأنواع.