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 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 and its rules, workflows, and 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 modeling the business process and abstracting the lower-level test integration tools.

In our exploration, we’ll identify Serenity/JS APIs to help to make our test code portable. You’ll also see how designing with portability in mind helps to create reusable 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 Modeling 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