Chapter 6: Refactoring with PageObjects
The main learning goal here will be to get familiar with how to upgrade a set of end-to-end tests (test suite) with a TestCafe role and the PageObject
pattern. We will use Role
to speed up the tests and will utilize PageObjects
to achieve reduced code duplication and enhanced maintainability. By the end of this chapter, we will have a structured and optimized set of tests and know how to apply roles and PageObject
patterns to any future projects.
In this chapter, we're going to cover the following main topics:
- Adding a
Role
for logging in. - Refactoring tests with
PageObjects
. - Improving
PageObjects
with functions.