E2E Test

E2E

اختبار من البداية إلى النهاية

GLS-000150

Intermediateengineering1 min read
end to end teste2e testingplaywrightcypressbrowser testintegration e2e

Definition

A test that simulates a real user interacting with the full app in a browser — clicking, filling forms, and verifying outcomes.

اختبار يُحاكي مستخدمًا حقيقيًا يتفاعل مع التطبيق الكامل في متصفح — النقر وملء النماذج والتحقق من النتائج.

Why It Matters

A unit test can't catch 'the glossary page crashes when the slug contains a dot'. An E2E test that navigates to /glossary/next.js in a real browser will catch it.

اختبار وحدة لا يمكنه اكتشاف 'صفحة الغلوساري تتعطل عندما يحتوي slug على نقطة'. اختبار E2E يتنقل إلى /glossary/next.js في متصفح حقيقي سيكتشفه.

Full Definition

E2E (End-to-End) tests run a real browser (via Playwright or Cypress) and simulate user workflows from start to finish. They test the entire stack: browser, Next.js server, Firestore, auth. They're slower than unit tests but catch integration bugs. 404Fault's regression.mjs test checks key public pages return 200 and specific content — a form of E2E smoke testing.
اختبارات E2E (من البداية إلى النهاية) تشغِّل متصفحًا حقيقيًا (عبر Playwright أو Cypress) وتُحاكي تدفقات عمل المستخدم من البداية إلى النهاية. تختبر المكدّس بأكمله: المتصفح وخادم Next.js وFirestore والمصادقة. أبطأ من اختبارات الوحدة لكنها تكتشف أخطاء التكامل. اختبار regression.mjs في 404Fault يفحص الصفحات العامة الرئيسية تُعيد 200 ومحتوى محددًا — شكل من اختبار الدخان E2E.

Example Usage

Playwright test: navigate to /glossary/react, verify 'React' heading is visible, click 'Read more', verify modal opens.

اختبار Playwright: التنقل إلى /glossary/react، التحقق من ظهور عنوان 'React'، النقر على 'اقرأ المزيد'، التحقق من فتح المودال.

Knowledge Graph

Avoid these mistakes when using E2E Test:

1

Flaky E2E tests due to timing (use waitForSelector instead of hardcoded delays)

2

Running E2E tests against production data (use a test account and test data)

Sign in to unlock guided AI explanations from AI Teacher.

Generate a Prompt

Copy this prompt and use it directly with any AI model — no setup needed.

Ready-to-Use Prompt
Help me build a project using E2E Test.

Explain:
1. What is E2E Test and why it matters
2. The core architecture and required tools
3. Step-by-step implementation plan
4. Common mistakes to avoid: Flaky E2E tests due to timing (use waitForSelector instead of hardcoded delays), Running E2E tests against production data (use a test account and test data)
5. Best practices and production tips

Official Resources