automation with frank
Post on 18-Dec-2014
146 Views
Preview:
DESCRIPTION
TRANSCRIPT
Presentation Highlights:
●What is Frank●Why Frank●How to use Frank●Conclusions●Q&A
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”
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
Disadvantages
• Doesn’t support Record and Play
• Improvements based usually only on community requests
• Lack of documentation
Frank Architecture
Communication
• Frankly - simple HTTP-based wire protocol.
• GET and POST requests
• Request and response bodies contain JSON
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
Frank Server
• Written in objective-C
• Compiled into the automated iOS application
• Provides responses to the Driver
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
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”.
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
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
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
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/
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
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.
Speaking the same language
• Cucumber supports over 40 spoken languages
• Listing the available languages: cucumber --i18n help
Ahoy! me buckos
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
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
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
Thank you!
email: ralu.mihordea@gmail.com
top related