Loading Depth Study
Preparing your workspace
End-to-end tests simulate real user flows through the complete application stack.
E2E tests are broader than unit or integration tests. They can open a real browser, navigate through pages, fill forms, click buttons, and verify the resulting application state. These tests can catch problems caused by routing, authentication, frontend-backend integration, browser behavior, or deployment configuration. Because E2E tests are slower and can be more fragile, teams usually keep the suite focused on high-value user journeys.
A learning platform can test the complete journey: login, open a course, start a lesson, mark it complete, and verify updated progress.
test('student can complete a lesson', async ({ page }) => {
await page.goto('/login');
await page.getByLabel('Email').fill('student@example.com');
await page.getByLabel('Password').fill('password');
await page.getByRole('button', { name: 'Login' }).click();
await page.goto('/courses/react');
await page.getByRole('button', { name: 'Complete Lesson' }).click();
await expect(page.getByText('Lesson completed')).toBeVisible();
});The browser completes the user journey and verifies that the lesson completion message appears.