chapter fifteen

15 Portable test automation with Serenity/JS

 

This chapter covers

  • Designing the domain layer of a test automation system
  • Design patterns supporting portable test automation
  • Leveraging non-UI interactions with Blended Testing
  • Test code encapsulation and reuse patterns

In chapter 14, you’ve learned how following the layered architecture pattern can support you in designing scalable test automation systems. You’ve also seen how introducing a specification layer can help you capture information about the business context, its rules, workflows, scenarios, as well as the actors interacting with the system and the goals they’re trying to accomplish.

In this chapter, we’ll continue to explore the idea of layering the architecture of our test automation system. We’ll investigate ways to reflect the concepts and vocabulary from the business domain in our test automation code. We’ll also study patterns that help to focus our implementation on modelling the business process and abstracting away the lower-level test integration tools.

In our exploration, we’ll identify Serenity/JS APIs that help to make our test code portable. You’ll also see how designing with portability in mind helps to create reusable test code. Test code that can be used in different contexts, and scale to support not only multiple test suites within your project, but also multiple teams across your organization.

15.1 Designing the domain layer of a test automation system

15.1.1 Modelling business domain tasks

15.1.2 Implementing business domain tasks

15.1.3 Composing interactions into tasks

15.1.4 Using an outside-in approach to enable task substitution

15.1.5 Leveraging non-UI interactions with Blended Testing

15.1.6 Using tasks as a mechanism for code reuse

15.1.7 Implementing verification tasks

15.2 Designing a portable Integration Layer

15.2.1 Writing portable tests for the Web interfaces

15.2.2 Identifying Page Elements

15.2.3 Implementing Lean Page Objects

15.2.4 Implementing Companion Page Objects

15.2.5 Implementing portable interactions with Page Elements

15.2.6 Using Page Element Query Language to describe complex UI widgets

15.2.7 Configuring Web integration tools

15.2.8 Sharing test code across projects and teams

15.3 Summary