Modern Web Testing with TestCafe
上QQ阅读APP看书,第一时间看更新

Chapter 1: Why TestCafe?

TestCafe—a new promising software testing framework or just a place where you can eat? Here, we will take a look at what TestCafe is and what its main features are. What is the technology? What do you need to know? How does it integrate with other tools? In this book, we will see what TestCafe is used for, go through its main features, and compare it with a well-known industry standard—Selenium.

More practically, we will develop a set of tests for a bug tracking system. You will learn how to write end-to-end tests using the TestCafe syntax and the features of the TestCafe framework. You'll go from setting up the environment all the way down to writing production-ready tests.

Throughout this book, we'll build a sample set of tests step by step that will log in to a website, verify the elements present on different pages, create/delete entities, and execute custom JavaScript code using TestCafe. Additionally, there will be several stages of refactoring to showcase setup/teardown and PageObjects.

Note

Please keep in mind that this book does not pretend to be the only source of truth - its main goal is to demonstrate some original approaches, not to enforce the strict rules. Feel free to use and extend all the techniques explored in this book.

By the end of this chapter, we will have a clear idea of TestCafe and what lies ahead—a plan of features that will be tested. We will also review the demo website and come up with a set of test cases that will be automated in the upcoming chapters.

To sum up the contents of this chapter, the following main topics will be covered:

  • Introducing TestCafe.
  • Exploring the main features of TestCafe.
  • Comparing TestCafe and Selenium.
  • Reviewing the test project we will build.