Building a Test Automation Framework is easy - there are so many resources / guides / blogs / etc. available to help you get started and help solve the issues you get along the journey.
However, building a "good" Test Automation Framework is not very easy. There are a lot of principles and practices you need to use, in the right context, with a good set of skills required to make the Test Automation Framework maintainable, scalable and reusable.
Design Patterns play a big role in helping achieve this goal of building a good and robust framework.
In this talk, we will talk about, and see examples of various types of patterns you can use for:
Build your Test Automation Framework
Test Data Management
Locators / IDs (for finding / interacting with elements in the browser / app)
Using these patterns you will be able to build a good framework, that will help keep your tests running fast, and reliably in your CI / CD setup!
26. ADVANTAGES OF
BUSINESS-LAYER PAGE-OBJECT PATTERN
¨ Validate what is important - Business requirements
¨ Test Pyramid remains sane
¨ Abstraction layers allow separation-of-concerns
¨ Changes are isolated
¨ Maintenance & Scaling becomes ‘easier’
28. Why do we need to
think differently
about Test Data?
29. CRITERIA FOR TEST DATA
¨ Data is complex
¨ Needs to mimic “real” data
¨ Needs to be unique
¨ Data can be nested
¨ Though specified as static, may need to be Dynamic
¨ Data can be shared and reused
30. DIFFERENT WAYS TO SPECIFY TEST DATA
¨ In Test implementation
¨ In Test specification / intent
¨ In code … separate data structures / classes / etc.
¨ External files
33. CRITERIA FOR SELECTION
¨ Easy to specify
¨ Easy to read and consume (by test framework)
¨ Ability to override specified data, easily
¨ Usable
34. TIPS FOR IMPLEMENTATION
¨ Consistent way to specify test data
¨ Read the data – as Business Entities
¨ Override as appropriate
¨ Create DSL to give meaning to data
¨ Use in test implementation
¨ Implement Test Data Entity Utilities – Build, Equals, Copy,
Find, etc.
38. ADVANTAGES OF PATTERNS
¨ Well known, well understood
¨ Tried & tested solutions for common problems
¨ Reduces complexity
¨ Language neutral
¨ Aid in communication
39. ADVANTAGES OF PATTERNS IN TEST AUTOMATION
Saves time & effort
(eventually)
Single ownership
Test Automation Code is of Production Quality!
Single point of change
Easy to –
- Implement
- Maintain
- Debug
- Scale