appium scripts: best practices and patterns
TRANSCRIPT
Get the most out of your
Appium Scripts:
Best Practices and PatternsBy Andreas Lüdeke from TestObject
About me
● CoFounder and CTO @ TestObject GmbH
● Senior Software Engineer @ IBM and SAP
● Appium Committer
Twitter: @aluedeke
Github: https://github.com/aluedeke
Problem: spaghetti test code
“The basic rule of thumb for a page object is that it should allow a software client to do anything and see anything that a human can.”
“It should also provide an interface that's easy to program to and hides the underlying widgetry in the window.“
Martin Fowler
http://martinfowler.com/bliki/PageObject.html
PageObject Pattern
Learnings: Page Objects● one PageObject per screen
● domain specific method names with simple signatures
● super short test methods ( < 10 lines)
● no Appium imports in tests
Learnings: test data● user your domain model
● put data into a central place
● no constructor calls/object creation in tests
● name your test data
Learnings: general● reuse code whenever possible (AbstractTest, AbstractScreen)
● read config from enviroment
● use whenever possible AppiumDriver
● write your tests first
Question?:
● checkout https://github.com/aluedeke/appium-best-practices
Twitter: @aluedeke