10 UI-based end-to-end testing

 

This chapter covers

  • UI and end-to-end tests
  • When to write each type of test
  • The business impact of end-to-end tests
  • An overview of multiple UI-based end-to-end testing tools

Sublime pieces of sugary treats can take a bakery a long way. Excellent customer service, beautifully decorated tables, and breathtaking views take it even further.

For customers to be enchanted, their experience must be flawless from the moment they step in to the moment they decide to leave, hopefully, wanting to come back.

No matter how good a pastry chef’s desserts are, if their bakery looks dirty, no one will come in.

Building delightful software involves a similar amount of care and attention to detail. Elegantly designed APIs are worthless if the buttons in the client’s user interface don’t work or if the information it displays is unreadable.

In this chapter, you’ll learn about UI-based end-to-end tests, the conceptual differences between them and other kinds of tests, how they impact your business, and the different tools available for writing them.

I’ll begin the chapter by explaining UI-based end-to-end tests and how they differ from other kinds of tests. In this first section, I’ll emphasize where these tests fit in the testing pyramid, explain how much they cost, and the benefits they yield so that you can decide whether you should adopt them, and understand how to incorporate them into your development process.

10.1 What are UI-based end-to-end tests?

10.2 When to write each type of test

10.2.1 UI-based end-to-end tests

10.2.2 Pure end-to-end tests

10.2.3 Pure UI tests

10.2.4 A note on acceptance testing and this chapter’s name

10.3 An overview of end-to-end testing tools

10.3.1 Selenium

10.3.2 Puppeteer

10.3.3 Cypress

10.3.4 When to choose Cypress

Summary