Summary
In this chapter, we learned about the Page Object design pattern and how it can be used to give a structure to the code we have written. We also went through refactoring, understanding the design pattern and how it has significantly improved the code readability and makes the maintenance look easier. We learned about assertions and how they can be used. We also learned about where assertion belongs and the pros and cons of each approach. We discussed some framework design principles of avoiding the dependent test designs and the importance of hooks, such as @Before
and @After
, provided by cucumber.
Now we have a decent framework in structure and the tests are a little mature with the design pattern in place. The next step is to be able to run the test on different targets, such as an emulator and an actual device, understand the hassles around it, and solve them.