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!
5. @BagmarAnand
Design Principles
• Principle of Least Knowledge – Talk only to your immediate friends
• Loose Coupled Principle – Loosely coupled design between objects that interact
28. @BagmarAnand
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’
30. Why do we need to
think differently
about Test Data?
@BagmarAnand
31. @BagmarAnand
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
32. @BagmarAnand
Different ways to specify Test Data
• In Test implementation
• In Test specification / intent
• In code … separate data structures / classes / etc.
• External files
35. @BagmarAnand
Criteria for selection
• Easy to specify
• Easy to read and consume (by test framework)
• Ability to override specified data, easily
• Usable
36. @BagmarAnand
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.
40. @BagmarAnand
Advantages of Design Patterns
• Well known, well understood
• Tried & tested solutions for common problems
• Reduces complexity
• Language neutral
• Aid in communication
41. @BagmarAnand
Advantages of Design 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
@BagmarAnand
42. @BagmarAnand
Which is the “best” pattern to use ?
https://cdn.pixabay.com/photo/2016/02/16/02/17/hands-1202488_1280.png