O'Reilly logo

Swing Extreme Testing by Tim Lavers, Lindsay Peters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Exercising UI Components in Tests

In this chapter, we introduce one of the key concepts in our user interface testing strategy—UI wrapper classes. The idea is that for each major user interface component, we create a class containing convenience methods for activating the controls in that component. This makes it extremely easy to write unit tests for the component. Further, because our wrappers do not actually need a reference to the component they control, they can be used in function tests. We'll see this use of UI wrappers in Chapter 17. Our introduction to UI wrappers will be via the unit tests for the LabWizard login screen.

The LabWizard Login Screen

Here is the login screen for LabWizard:

Every time a customer uses LabWizard, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required