appium scripts: best practices and patterns

11
Get the most out of your Appium Scripts: Best Practices and Patterns By Andreas Lüdeke from TestObject

Upload: testobject-mobile-testing

Post on 09-Jan-2017

429 views

Category:

Technology


0 download

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

Agenda:● Take some ugly test code and improve it a lot

“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

http://martinfowler.com/bliki/images/pageObject/pageObject.png

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