For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester ....

32
Architecture For test automation frameworks @craftingtester

Transcript of For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester ....

Page 1: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

ArchitectureFor test automation

frameworks

@craftingtester

Page 2: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

@craftingtester

Sven Kroell

Testing Toolsmith

8 years in Testing

5 Years in Automation

Mentoring new Testers Creating tailored solutions

Traveller and Hiker

Page 3: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

@craftingtester

Page 4: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

End to End

Integration

Unit

The pyramid

4

@craftingtester

Page 5: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

5

Why automate?

© Michal Parzuchowski

@craftingtester

Page 6: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

6Record and play

© Robert Lischka

@craftingtester

Page 7: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

7

@craftingtester

© Markus spieske

Page 8: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

8

Do it yourself@craftingtester

Page 9: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

@craftingtester

Page 10: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

1 0

Time flows by@craftingtester

© Sven Kroell

Page 11: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

1 1

Repairing on the fly@craftingtester

© Fancycrave

Page 12: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

1 2

How to do it better?@craftingtester

© Sven Kroell

Page 13: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

1 3

Building a framework@craftingtester

© Sven Kroell

Page 14: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

➡ Separation of concerns ➡ Build a domain language ➡ Keeping the checks simple ➡ Reusable components

Why a framework

@craftingtester

Page 15: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

What went wrong?Locators

Testdata

Userflows

Repetitions

Magic code

Sleeps

@craftingtester

Page 16: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

@craftingtester

Page 17: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

Think in layers

Checks

Framework

Driver

Application

@craftingtester

Page 18: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

Checks@craftingtester

© Gerd Altman

Page 19: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

Layers of the FrameworkChecks

Driver

Repositories Workflows

Page Objects

Data Generators

DataAccess Objects

@craftingtester

Page 20: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

Repositories

© Pexels

Repositories@craftingtester

Page 21: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

@craftingtester

Page 22: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

➡ Centralised data generation ➡ Single point of change ➡ Checks don’t need to know data rules

Why repositories?

@craftingtester

Page 23: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

Workflows@craftingtester

Page 24: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

2 4

@craftingtester

Page 25: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

➡ Decouple flows from checks ➡ Checks get cleaner ➡ Using a DSL makes it easier for new

joiners to get up to speed

Why workflows?

@craftingtester

Page 26: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

Page Objects@craftingtester

Page 27: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

2 7

@craftingtester

Page 28: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

➡ Hides complexity of the DOM from workflows

➡ Single point of change for identifiers

Why Page Objects?

@craftingtester

Page 29: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

Lets have a small demo

@craftingtester

Page 30: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

Remarks

Pitfalls@craftingtester

© Sven Kroell

Page 31: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

➡ Creating checks is software development

➡ Clean code is very important ➡ A good architecture helps while

refactoring ➡ Developers become more engaged

Final thoughts

@craftingtester

Page 32: For test automation frameworks - TestCon Moscow · For test automation frameworks @craftingtester . @craftingtester Sven Kroell Testing Toolsmith 8 years in Testing 5 Years in Automation

3 2

Questions@craftingtester

© Sven Kroell