8 Advanced web API automation

 

This chapter covers

  • Using automation to guide delivery
  • Improving automation stability with mocks
  • Considerations when adding automated checks to a build pipeline

As web API technology has advanced, so have the tools for supporting our automation. In chapter 6, we discovered how to build automated checks for APIs that can help indicate potential issues for further investigation, but there is much more we can do. Therefore, in this chapter, we’ll build on our knowledge of automating API checks and explore how we can take our automation further to help us in different ways. To do this, each section in this chapter will explore a way in which we can get more out of our automation, such as by

  • Guiding our delivery with automated acceptance testing
  • Reducing false positives in our automation with the use of mocks
  • Using property-based testing to discover unexpected issues

8.1 Acceptance test-driven development

8.1.1 Setting up an automated acceptance testing framework

8.1.2 Creating our failing automated check

8.1.3 Getting our automated check to pass

8.1.4 Beware of traps

8.2 Web API mocking

8.2.1 Getting set up

8.2.2 Building our mocked check

8.3 Running as part of a pipeline

8.3.1 Integrated with codebase

8.3.2 Separate to codebase

Summary