Transcript
Page 1: Automation With Frank
Page 2: Automation With Frank

Presentation Highlights:

●What is Frank●Why Frank●How to use Frank●Conclusions●Q&A

Page 3: Automation With Frank

What is Frank?

● Basic 'Selenium for native iOS apps'.

● Write automated acceptance tests

● Verify the functionality of native iOS apps.

● Symbiote - a powerful “app inspector”

Page 4: Automation With Frank

Why: Advantages

• Easy Setup - less than 10 minutes.

• Record Video - of the test runs to show the app in action

• Run everywhere - has support for Simulator and Device

• Integrates with CI - run on every check in

• Great Community - strong, helpful community Google Group

Page 5: Automation With Frank

Disadvantages

• Doesn’t support Record and Play

• Improvements based usually only on community requests

• Lack of documentation

Page 6: Automation With Frank

Frank Architecture

Page 7: Automation With Frank

Communication

• Frankly - simple HTTP-based wire protocol.

• GET and POST requests

• Request and response bodies contain JSON

Page 8: Automation With Frank

Response Format

• Responses may either be standard or non-standard. • A standard response always conforms to a format similar to:

{ 'outcome': 'SUCCESS', 'results': ['foo','bar']}

indicating a failure format:

{ 'outcome': 'ERROR', 'reason': 'Failed to frob the flib', 'detail': 'Flange capacitator decoupled'}

• Non-standard responses will be valid JSON documents

Page 9: Automation With Frank

Frank Server

• Written in objective-C

• Compiled into the automated iOS application

• Provides responses to the Driver

Page 10: Automation With Frank

Frank Driver

• Cucumber Driver - implemented in ruby

• Shelley - a selector engine to access a subset of UI elements.

• Create additional drivers rewriting frank_helpers.rb

• Frank helpers - a core set of helper functions

Page 11: Automation With Frank

How to use Frank

• Designed to work with Cucumber.

• Can be adapted to other languages too.

• Examples: Cucumber and Java.

turn on the accessibility features on the machine hosting your iOS simulator.

Go to System Preferences -> Universal Access and Check “Enable access for assistive devices”.

Page 12: Automation With Frank

Frankify the app

• the process of adding a separate Frank target to your app

• has the Frank server embedded into it

• allowing it to respond to automation commands.Frankified application

Application Frank Server

Page 13: Automation With Frank

Frankify the app

• install the frank-cucumber gem by running:

sudo gem install frank-cucumber

(run this into the project's root directory – the one with the .xcodeproj file)

• create the Frank subdirectory which contains everything necessary to Frankify you app by running

frank setup

Page 14: Automation With Frank

Frankify the app

• create a Frankified version of you app by running:

frank build• launch the Frankified app in the simulator by running:

frank launch• check that you are indeed running a Frankified version by

running:

frank inspect

Page 15: Automation With Frank

Symbiote

● creates a tree structure with the UI Elements from you app.

● must have the app running in the simulator.

● the application should be exactly on the same screen as Symbiote, for it to work.

● when investigating a different screen, the browser must be refreshed.

● access it from browser at http://localhost:37265/

Page 16: Automation With Frank

Shelley

● Symbiote uses Shelley to access the UI Elements via queries.

● Verify if an element is accessible from browser using a query that should have the final result highlighting the desired element.

● Examples of queries:

○ view:'UILabel' marked:'Saved Tabs'

parent view:'TableViewCell'

○ button:"UIButton" marked:'btn plus' index:0

Page 17: Automation With Frank

Frank using Cucumber

• Cucumber - a tool that executes plain-text functional descriptions as automated tests.

• Gherkin

– the language that Cucumber understands.

– Business Readable, Domain Specific Language

– serves two purposes — documentation and automated tests.

Page 18: Automation With Frank

Speaking the same language

• Cucumber supports over 40 spoken languages

• Listing the available languages: cucumber --i18n help

Ahoy! me buckos

Page 19: Automation With Frank

Example

Feature: Navigating between screens

Scenario: Moving from the 'Home' screen to the 'Events' screen and navigate through it

Given I launch the app

When I navigate to "Events"

Then I should be on the Events screen

When I navigate Events to "Count Down"

Then I should be on the Count Down screen

Page 20: Automation With Frank

Conclusions

• Open source tool for automation testing against iOS apps

• Adaptable to one’s needs

• Uses the power provided by Apple’s framework

• Great community that provides support

Page 21: Automation With Frank

Bibliography

• The Official Website: testingwithfrank.com

• The GitHub Repository: moredip/Frank

• Pete Hodgson’s Blog: Being Agile

• Google Group: Frank

• Frank Helpers: rdoc.info/gems/frank-cucumber

Page 22: Automation With Frank

Thank you!

email: [email protected]


Top Related