Skip to main content

Frontend Testing Overview

Frontend testing checks whether an application's interface works correctly, remains reliable after changes, and provides a good user experience.

Test small parts

Test connected parts

Test complete user flows

Check quality across browsers, users and conditions

One-line idea: Different tests catch different kinds of problems, so frontend applications need more than one testing type.

Testing Fundamentals

Why Frontend Testing Matters

Testing helps confirm that:

  • components and functions behave correctly
  • connected features work together
  • complete user journeys succeed
  • existing features survive new changes
  • the application remains fast, accessible, compatible and secure

Core Testing Levels

LevelScopeSimple meaning
UnitOne function or componentDoes this individual part work?
IntegrationConnected components or modulesDo these parts work together?
End-to-EndComplete application flowCan the user finish the whole journey?
Function or component -> Unit test
Connected feature -> Integration test
Complete journey -> E2E test

The remaining testing types focus on qualities such as stability, performance, accessibility, compatibility, usability, security and regional support.

Types of Frontend Testing

Testing typeShort purposeSimple exampleCommon tools or method
Unit TestingTests one component or function in isolation.Check whether a price formatter returns the correct result.Jest, Mocha, Jasmine
Integration TestingChecks whether multiple components or modules work together correctly.Add an item and verify that the cart summary updates.Cypress, Selenium, Puppeteer
End-to-End TestingTests a complete flow from the UI through the rest of the application.Log in, add a product, complete checkout and see confirmation.Cypress, Selenium, Playwright
Regression TestingConfirms that new changes did not break existing behavior.Rerun checkout tests after adding discount logic.Automated suites, CI/CD pipelines
Performance TestingMeasures speed, responsiveness and behavior under different conditions.Check page loading and rendering performance.Lighthouse, PageSpeed Insights, WebPageTest
Accessibility TestingChecks whether people with disabilities can use the interface.Verify keyboard access, labels and detectable accessibility issues.Lighthouse, axe, Pa11y
Cross-Browser TestingConfirms that the application works across different browsers.Test the checkout page in Chrome, Firefox and Safari.BrowserStack, CrossBrowserTesting, Sauce Labs
Usability TestingEvaluates how easily real users can understand and navigate the UI.Observe whether users can find and use the checkout button.Manual testing, user feedback
Security TestingFinds vulnerabilities that could expose the application or its users.Scan the application for common security weaknesses.OWASP ZAP, Burp Suite, Snyk
Localization and Internationalization TestingChecks different languages, formats and regional settings.Verify translated text, currency and regional values.Mainly manual checks and regional test cases
A/B TestingCompares two UI versions to learn which produces a better outcome.Show two checkout button designs and compare conversions.Split traffic and analyze user responses
TDDWrites a failing test before implementing the code, then improves the solution.Write the expected cart-total test before creating the calculation.Development approach supported by test tools

Important Distinctions

Unit vs Integration vs E2E

Unit        -> one part
Integration -> connected parts
E2E -> complete flow

Regression testing is not limited to one test level. Unit, integration and E2E tests can all be rerun after code changes to detect regressions.

A/B testing compares product variations and user responses. Its primary goal is learning which variation performs better, not simply proving that code is correct.

TDD is a development approach rather than a separate application layer.

Write a failing test

Write enough code to pass

Improve the code safely

One Feature Across Different Tests

For an e-commerce checkout:

TypeWhat could be checked?
UnitThe cart-total function calculates the correct amount.
IntegrationAdding a product updates the cart summary.
E2EThe user completes the full purchase flow.
RegressionCheckout still works after a pricing change.
PerformanceThe checkout page loads and responds quickly.
AccessibilityThe flow works with keyboard navigation and proper labels.
Cross-browserThe flow behaves consistently across supported browsers.
UsabilityUsers can understand and complete the flow easily.
SecurityThe application does not expose common vulnerabilities.
LocalizationText, currency and regional settings display correctly.
A/BTwo checkout designs are compared using user results.

Tool Reference

AreaCommon tools from the source
UnitJest, Mocha, Jasmine
Integration and E2ECypress, Selenium, Puppeteer, Playwright
PerformanceLighthouse, PageSpeed Insights, WebPageTest
Accessibilityaxe, Pa11y, Lighthouse
Cross-browserBrowserStack, CrossBrowserTesting, Sauce Labs
SecurityOWASP ZAP, Burp Suite, Snyk

Tools can overlap. The important choice is the testing goal, not only the tool name.

Quick Revision

Key Points

  • Unit tests check isolated parts.
  • Integration tests check connected parts.
  • E2E tests check complete user journeys.
  • Regression tests protect existing behavior after changes.
  • Performance tests measure speed and responsiveness.
  • Accessibility tests check usability for people with disabilities.
  • Cross-browser tests check compatibility across browsers.
  • Usability tests study how easily people use the interface.
  • Security tests identify vulnerabilities.
  • Localization testing checks languages and regional behavior.
  • A/B testing compares variations using user results.
  • TDD starts with a test before implementation.

Quick Questions

What is the difference between unit and integration testing?

A unit test checks one isolated part. An integration test checks whether multiple parts work together.

What does E2E testing verify?

It verifies a complete application flow from the user's interface through the connected system.

Why is regression testing important?

It helps detect when a new change breaks functionality that previously worked.

Does A/B testing check code correctness?

Not primarily. It compares variations to determine which produces a better user or business result.

Is TDD a testing level?

No. TDD is a development workflow in which tests are written before the implementation.

Memory Trick

Part -> Connection -> Journey -> Quality

Part = Unit
Connection = Integration
Journey = E2E
Quality = Regression, performance, accessibility,
compatibility, usability and security

One-Line Summary

Frontend testing combines focused tests, complete-flow tests and quality checks to keep the interface correct, reliable and usable.

Final Mental Model

Does one part work?              -> Unit
Do connected parts work? -> Integration
Can the user finish the journey? -> E2E
Did a change break old behavior? -> Regression
Is the experience high quality? -> Performance, accessibility,
browser, usability and security tests
Does it work across regions? -> Localization testing
Which version performs better? -> A/B testing
Do tests guide implementation? -> TDD