# Three Flavors of Pokémon - Framework Agnostic UI Testing

- Speaker: [Shelly Goldblit](/wiki/speakers/shelly-goldblit.md)
- Event: [Reversim Summit 2024](/wiki/years/2024.md)
- Video: https://www.youtube.com/watch?v=ZPDgqJKocvs
- Transcript: [/transcripts/2024/20-ZPDgqJKocvs.md](/transcripts/2024/20-ZPDgqJKocvs.md)
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: [Frontend](/wiki/topics/frontend.md), [Testing](/wiki/topics/testing.md), [Software Engineering](/wiki/topics/software-engineering.md), [Technical Debt](/wiki/topics/technical-debt.md)

> Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

## Summary

The speaker discusses how to build robust UI tests that remain unaffected by implementation changes by treating the application as a black box. The main argument is that using test helpers and the driver pattern creates a necessary decoupling between test code, production code, and testing frameworks. By structuring tests this way, developers can ensure reliability, maintainability, and readability over time. The audience learns how to implement these patterns across different frontend frameworks using practical examples.

## Key points

- [1:00](https://www.youtube.com/watch?v=ZPDgqJKocvs&t=60s) The speaker introduces the dangers of flaky tests and high maintenance caused by small functional changes and tight coupling.
- [4:00](https://www.youtube.com/watch?v=ZPDgqJKocvs&t=240s) Good tests must be reliable, maintainable, and readable, treating test code with the same respect as production code.
- [7:30](https://www.youtube.com/watch?v=ZPDgqJKocvs&t=450s) The speaker demonstrates end-to-end, integration, and unit tests using a simple Pokémon catalog application implemented in three different frameworks.
- [14:46](https://www.youtube.com/watch?v=ZPDgqJKocvs&t=886s) Test helpers are introduced to decouple test code from the testing framework, allowing easier migration between tools like Cypress and Playwright.
- [16:57](https://www.youtube.com/watch?v=ZPDgqJKocvs&t=1017s) The driver pattern helps achieve decoupling between production code and test code by focusing on inputs, actions, and outputs rather than implementation details.
- [20:02](https://www.youtube.com/watch?v=ZPDgqJKocvs&t=1202s) Component drivers can be composed together to build page and application drivers, creating reusable building blocks for complex flows.
- [23:04](https://www.youtube.com/watch?v=ZPDgqJKocvs&t=1384s) When a bug is discovered, writing a failing test first using the established drivers ensures the bug is caught and safely fixed without breaking existing functionality.

## Takeaways

- Treat test code with the same high standards and care as production code.
- Use test helpers to wrap testing frameworks and achieve framework-agnostic test code.
- Apply the driver pattern to hide implementation details and focus tests on user-facing outputs.
- Compose smaller component drivers into larger page drivers to maintain clean and scalable test suites.

## Questions this talk answers

- How can we prevent UI tests from breaking when internal implementation details or component structures change?
- What is the difference between a test helper and a test driver, and how do they work together?
- How can we structure test code so it remains readable and maintainable across multiple frontend frameworks?

## Technologies

Cypress, Playwright, React, Angular, Lit

## Tags

design patterns, framework agnostic, frontend testing, maintainability, test automation, ui testing
