Blog

Testing web components vs. UI elements - Richard Seidl

Written by Richard Seidl | 02/25/2025

The test methodology for web components is becoming increasingly important compared to conventional UI tests. Applying a new approach that takes the user perspective more into account can significantly increase the efficiency and effectiveness of software projects. Tools such as Cypress and Playwright make it possible to test front-end applications in isolation and offer versatile options for integration into existing test processes. Challenges and successes in the implementation of these new test strategies provide valuable insights and show which trends and developments can be expected in the test landscape.

Podcast Episode about testing web components vs. ui elements

In this episode, I talk to Felix Wunderlich from Volkswagen about web component testing versus UI testing. Felix shares his experiences and shows the benefits of a new approach that better reflects the user perspective and increases efficiency. We discuss the use of tools such as Cypress and Playwright to test frontend applications in isolation. Felix reports on the challenges and successes of implementing this approach and gives insights into future developments in his testing environment.

"The main point is actually that with every change, no matter how small, we can be sure that our UI as a whole still works as it should from the user's perspective." - Felix Wunderlich

Felix Wunderlich is a passionate software developer with a particular fondness for functional programming, testing and complex problems. He studied computer science with a focus on software engineering, IT security and human computation at LMU Munich. Since 2018, he has been working as a software engineer at the Software Development Center of Volkswagen AG in Wolfsburg.

Highlights of the Episode

  • Testing web components vs. user interface (UI)
  • Challenges and solutions when testing front-end applications
  • Using tools like Cypress and Playwright for testing
  • Improving code quality through comprehensive testing
  • Open environment for experiments and new ideas in the team

Why test web components when you can test the UI?

Introduction

UI testing plays a crucial role in the software development process. It allows you to check the user interface of your applications and ensure that it meets user expectations. Test automation in this area not only improves efficiency, but also contributes to software quality.

In this article you will learn about the following aspects:

  • The importance of testing web components
  • Challenges and opportunities in UI testing
  • Benefits and best practices for effective UI testing
  • Insights into tools such as Playwright and Cypress

The goal is to provide you with practical information and perspectives to deepen your understanding of UI testing and facilitate its implementation into your development process.

Why test web components? A look at the challenges and opportunities

Web components are reusable building blocks that enable developers to create complex user interfaces efficiently. They play a central role in modern web design as they promote modularity and flexibility. By using web components, teams can create consistent UI elements that can be used in different projects.

However, testing web components comes with specific challenges:

  • Complexity: The interaction between different components can cause unpredictable problems. Each component might behave differently depending on its context within the application.
  • Browser compatibility: Web components need to work in different browsers. This variety of platforms requires extensive testing to ensure that all users have a consistent experience.

Various approaches are available to meet these challenges:

  • Test automation tools: Using tools such as Playwright or Cypress allows developers to automate tests and review the user interface from the end user's perspective. These tools support multiple browsers and significantly improve the efficiency of test processes. In particular, test automation of mobile apps, shows how flexibility and teamwork lead to effective solutions and valuable insights.
  • Mocking techniques: By simulating backend responses, developers can perform isolated testing for their components. This reduces dependencies and speeds up the test process.

By integrating these strategies, web component testing becomes not only more effective, but also more practical for development teams who value quality.

The benefits of UI testing: why it's an important test strategy

What are UI tests?

UI tests (user interface tests) appraise the user interface of an application from the perspective of the end user. They differ from traditional component testing, which often tests isolated parts of the application. UI tests simulate real user scenarios and evaluate the behavior of the entire application, while component testing focuses on individual, isolated functions.

Advantages of UI testing:

  • Real user experience: UI testing allows you to test the application as a user would. This method provides valuable insights into usability and the overall experience.
  • Early problem detection: By simulating real interactions, problems with the user interface can be detected early. This reduces the likelihood of bugs being discovered at later stages of the development process.
  • End-to-end testing integration: While end-to-end testing is often time-consuming and complex, UI testing provides a faster and effective way to ensure that all parts of the application work together seamlessly.
  • Time savings: The ability to run multiple tests in parallel significantly improves efficiency. This enables faster feedback cycles and shorter development times.

Implementing UI testing not only increases software quality, but also optimizes the entire development process. The early detection and elimination of problems increases the stability of the application. This creates a solid foundation for future developments.

To take full advantage of these benefits, test automation is a crucial step. Test automation with Selenium in particular has proven to be extremely effective. It enables precise testing and can be easily integrated into existing projects. To learn more about the basics and techniques of test automation, I recommend the book Basiswissen Testautomatisierung.

Tools for effective UI testing: A look at Playwright and Cypress

Choosing the right test automation tools is crucial to the success of UI testing. Playwright and Cypress are two of the most popular tools on the market to help developers effectively test their user interfaces.

Playwright

  • Developed by Microsoft, allows you to run tests in multiple browsers (Chromium, Firefox and WebKit).
  • Provides a powerful API to simulate complex user interactions.
  • Supports mobile application testing through emulated mobile device support.
  • Enables interception and mocking of network calls, which simplifies the execution of isolated tests.

Cypress

  • Focuses on end-to-end testing and offers a user-friendly interface.
  • Real-time test run: Instantly see how your application responds to testing, making debugging easier.
  • Is ideal for developers who need quick feedback on UI changes. However, it has limitations in supporting multiple browsers.

The user focus in the test process: how it improves quality assurance

The user perspective plays a crucial role in software application testing. By understanding the needs and expectations of users, testers can ensure that the software developed is not only functional, but also user-friendly. The following aspects illustrate the importance of this perspective:

1. identification of vulnerabilities

By putting themselves in the user's shoes, testers can identify potential problems that may arise during normal use.

2. realistic test scenarios

Tests based on realistic user scenarios provide valuable insights into the actual use of the software. This not only tests the functionality, but also improves the user experience.

User feedback is another important factor that influences test strategies. It enables developers to make changes based on the experiences of real users. The integration of feedback leads to:

  • Improved software quality: When testers consider direct feedback from users, specific adjustments can be made. This reduces the risk of errors and ensures higher satisfaction.
  • Iterative development process: Continuously collecting and analyzing user feedback encourages an iterative approach to software development. This leads to constant improvements and dynamic adaptation to user needs.

Focusing on the user perspective during testing thus has a direct influence on quality assurance and makes a decisive contribution to the creation of high-quality software solutions. Test automation, as practiced today, significantly increases efficiency in quality assurance. Modern approaches are revolutionizing software development and enabling testers to focus more on the user perspective.

In addition, the transition to open source test automation can be a valuable strategy. This approach not only increases efficiency, but also significantly reduces manual intervention.

Practical experience: The implementation of UI testing at Volkswagen

Felix Wunderlich describes the exciting process of migrating from end-to-end testing and component testing to UI testing within VW Software Development. The decision to move away from traditional testing methods arose from the need for greater efficiency and a better user perspective.

Challenges

The implementation brought with it various challenges:

  • Complexity of existing testing: The original end-to-end testing was time-consuming and often unreliable. These E2E test automation challenges are a known problem in many organizations.
  • Reusability of components: For many user flows, identical tests had to be written multiple times, leading to redundancy.
  • Changes in the CSS selectors: Such changes required adjustments to multiple test cases and resulted in additional effort.

Solutions

To overcome these hurdles, the following approaches were pursued:

  • Centralization of UI elements: CSS selectors were collected in one place to facilitate maintenance.
  • Utilization of mocking techniques: Simulated backend responses allowed the UI to be tested in its entirety without relying on a full system.
  • Agile values as a foundation: The open exchange within the team promoted innovative solutions and accelerated the acceptance of new methods.

These measures not only led to faster test times, but also to higher software stability and quality.

The future of UI testing: best practices and new methods

The future of testing in companies like Volkswagen is promising. As UI testing becomes more widely accepted, innovative methods and best practices are being developed that can significantly improve quality assurance.

Some of the key best practices for effective UI testing include:

  • Centralization of testing resources: All UI elements, CSS selectors, and backend communications should be centrally managed. This facilitates adjustments when changes are made to the API or frontend.
  • Use of mocking techniques: By creating fake responses to backend requests, the frontend can be tested in isolation. This increases the speed and stability of the tests.
  • Parallelization of tests: To increase efficiency, tests should be executed in parallel. Tools such as Playwright offer this possibility and thus significantly reduce the total time for test runs.
  • Experiment with new approaches: Teams should be encouraged to try out new testing methods. The iterative approach promotes innovation in the test process.

Spreading these best practices across the industry will be crucial to ensure high software quality. In the coming years, companies are expected to focus more on user-centered testing methods to meet the requirements of modern web applications. The acceptance and integration of such strategies could lead to UI testing becoming a standard practice in software development.

Conclusion: The importance of UI testing for software quality

Summarizing the findings shows that UI Testing plays a central role in the software development process. The advantages are manifold:

  • Early error detection: Problems with the user interface are identified at an early stage.
  • Realistic user scenarios: Tests simulate real user interactions and behavior.
  • Increased code quality: Regular UI testing improves software stability and reliability.

The implementation of UI tests, as demonstrated at Volkswagen, has the potential to significantly increase software quality. With tools such as Playwright and Cypress, developers can test efficiently and ensure that their applications meet user requirements. Ultimately, this not only leads to higher user satisfaction, but also to less costly rework in later development phases. UI testing is therefore an indispensable part of modern software development.

Frequently asked Questions

What best practices should companies follow in UI testing?

Companies should follow these best practices for UI testing: Start with clear test objectives and define the most important user interactions. Use automated testing for recurring scenarios, while manual testing for complex, undefined specific features. Integrate testing early in the development process to detect errors at an early stage. Pay attention to different devices and screen sizes to ensure a consistent user experience. Finally, test results should be documented and appraised regularly to enable continuous improvement.

What is UI testing and why is it important?

UI testing is the process of testing an application's user interface for functionality and usability. It is important because it ensures that users have a positive experience and that all functions work as expected. Through UI testing, errors can be detected and corrected at an early stage, which increases user satisfaction. It also supports quality assurance and prevents "undefined" problems from entering the production environment. This ultimately protects the company from potential losses and improves the software overall.

What are the challenges of testing web components?

One of the biggest challenges in testing web components is the undefined dependency on different browsers and devices, which can lead to inconsistent behavior. In addition, the interaction with third-party services is often complex, which makes testing more difficult. State management within components can also cause problems if tests do not cover all possible states. Finally, a lack of documentation and standards can make testing more complicated.

What advantages do UI tests offer compared to conventional component testing?

UI testing offers the advantage that it checks the user interface in realistic usage scenarios, while conventional component testing often only tests isolated functionalities. As a result, UI tests also capture the user experience, which is crucial for the acceptance of the software. In addition, they can uncover problems in the interaction between different components that may go unnoticed in "undefined" component testing. These tests promote better customization to user needs and ensure the quality of the application from the end user's perspective.

What are Playwright and Cypress and how do they differ?

Playwright and Cypress are tools for automated testing of web applications. Playwright supports multiple browsers and platforms, while Cypress is specifically optimized for testing web applications in Chrome and similar browsers. A key difference is that Playwright also works in headless environments and can enable multi-tab scenarios, which Cypress does not offer. Both tools have their strengths, but the choice often depends on the specific requirements of the project and the desired support for undefined.

How can the user perspective improve quality assurance in the test process?

The user perspective can significantly improve quality assurance in the test process by ensuring that the software meets the actual needs of the users. User feedback and usability testing identify weaknesses at an early stage. By evaluating the application from the user's perspective, testers can take real-life usage scenarios into account and optimize usability. This increases the likelihood that the software will function effectively and efficiently. In this context, the concept of "undefined" also becomes relevant, as it helps to identify unexpected problems from the end user's perspective.

What best practices should companies follow in UI testing?

Companies should observe the following best practices in UI testing: Define clear test objectives and test early to catch bugs early. Use automated tests for repetitive tasks to save time. Consider different devices and browsers to ensure comprehensive coverage Conduct usability tests to improve the user experience. Implement regular updates and feedback loops. Use undefined tools to support the test process. Document results thoroughly to encourage learning and adaptation. These measures increase quality and user satisfaction.