UI Testing With Frank
         BDD Style Acceptance
   Testing with Frank and Cucumber
@keithpitt

    Keith Pitt

iOS/Web Developer
The Frontier Group
UI Testing Approaches
UI Testing Approaches
• Testing the application yourself using the
  simulator or your device
UI Testing Approaches
• Testing the application yourself using the
  simulator or your device
• Getting others to test the application using
  their own devices
UI Testing Approaches
• Testing the application yourself using the
  simulator or your device
• Getting others to test the application using
  their own devices
• Automated testing
What tools are there?
What tools are there?
• Sikuli (image analysis)
What tools are there?
• Sikuli (image analysis)
• Fonemonkey (record and playback)
What tools are there?
• Sikuli (image analysis)
• Fonemonkey (record and playback)
• UISpec (tests are written in Objective C)
What tools are there?
• Sikuli (image analysis)
• Fonemonkey (record and playback)
• UISpec (tests are written in Objective C)
• iCuke (project not being developed)
Frankenstein
Frank
Frank
• A bridge between Cucumber and UISpec
Frank
• A bridge between Cucumber and UISpec
• A “Frank Driver” that sends HTTP requests
  from Cucumber to a “Frank Server” that is
  installed in the Application
Frank
• A bridge between Cucumber and UISpec
• A “Frank Driver” that sends HTTP requests
  from Cucumber to a “Frank Server” that is
  installed in the Application
• The “Frank Server” executes UISpec
  queries against the application, returns the
  result
UISpec
UISpec
• UISpec is a Behaviour Driven Development
  framework for the iPhone that provides a
  full automated testing solution that drives
  the actual iPhone UI.
UISpec
• UISpec is a Behaviour Driven Development
  framework for the iPhone that provides a
  full automated testing solution that drives
  the actual iPhone UI.
• It is modelled after the very popular RSpec
  for Ruby.
UISpec
• UISpec is a Behaviour Driven Development
  framework for the iPhone that provides a
  full automated testing solution that drives
  the actual iPhone UI.
• It is modelled after the very popular RSpec
  for Ruby.
• Written in Objective C
-(void)itShouldHaveDefaultUsers {
        //Check that all default users are in list
        [[app.tableView.label text:@"Larry Stooge"] should].exist;
        [[app.tableView.label text:@"Curly Stooge"] should].exist;
        [[app.tableView.label text:@"Moe Stooge"] should].exist;
}
Cucumber
Cucumber
• Cucumber is a tool that executes plain-text
  functional descriptions as automated tests.
Cucumber
• Cucumber is a tool that executes plain-text
  functional descriptions as automated tests.
• Written in Ruby
Cucumber
• Cucumber is a tool that executes plain-text
  functional descriptions as automated tests.
• Written in Ruby
• Created originally for use with Ruby on
  Rails.
Cucumber
• Cucumber is a tool that executes plain-text
  functional descriptions as automated tests.
• Written in Ruby
• Created originally for use with Ruby on
  Rails.
• Command line tool
Cucumber
• Cucumber is a tool that executes plain-text
  functional descriptions as automated tests.
• Written in Ruby
• Created originally for use with Ruby on
  Rails.
• Command line tool
• Written specifically for BDD
Feature: Search courses
 In order to ensure better utilization of courses
 Potential students should be able to search for courses

 Scenario: Search by topic
  Given there are 240 courses which do not have the topic "biology"
  And there are 2 courses A001, B205 that each have "biology" as one of the topics
  When I search for "biology"
  Then I should see the following courses:
   | Course code |
   | A001       |
   | B205       |
Demo
Resources
• https://github.com/moredip/Frank
• https://github.com/aslakhellesoy/cucumber
• http://www.melbournecocoaheads.com/
  testing-ios-apps-with-frank-slides-and-
  videos/
@keithpitt

   Thanks for
 your attention

iOS UI Testing with Frank

  • 1.
    UI Testing WithFrank BDD Style Acceptance Testing with Frank and Cucumber
  • 2.
    @keithpitt Keith Pitt iOS/Web Developer The Frontier Group
  • 3.
  • 4.
    UI Testing Approaches •Testing the application yourself using the simulator or your device
  • 5.
    UI Testing Approaches •Testing the application yourself using the simulator or your device • Getting others to test the application using their own devices
  • 6.
    UI Testing Approaches •Testing the application yourself using the simulator or your device • Getting others to test the application using their own devices • Automated testing
  • 7.
  • 8.
    What tools arethere? • Sikuli (image analysis)
  • 9.
    What tools arethere? • Sikuli (image analysis) • Fonemonkey (record and playback)
  • 10.
    What tools arethere? • Sikuli (image analysis) • Fonemonkey (record and playback) • UISpec (tests are written in Objective C)
  • 11.
    What tools arethere? • Sikuli (image analysis) • Fonemonkey (record and playback) • UISpec (tests are written in Objective C) • iCuke (project not being developed)
  • 12.
  • 13.
  • 14.
    Frank • A bridgebetween Cucumber and UISpec
  • 15.
    Frank • A bridgebetween Cucumber and UISpec • A “Frank Driver” that sends HTTP requests from Cucumber to a “Frank Server” that is installed in the Application
  • 16.
    Frank • A bridgebetween Cucumber and UISpec • A “Frank Driver” that sends HTTP requests from Cucumber to a “Frank Server” that is installed in the Application • The “Frank Server” executes UISpec queries against the application, returns the result
  • 17.
  • 18.
    UISpec • UISpec isa Behaviour Driven Development framework for the iPhone that provides a full automated testing solution that drives the actual iPhone UI.
  • 19.
    UISpec • UISpec isa Behaviour Driven Development framework for the iPhone that provides a full automated testing solution that drives the actual iPhone UI. • It is modelled after the very popular RSpec for Ruby.
  • 20.
    UISpec • UISpec isa Behaviour Driven Development framework for the iPhone that provides a full automated testing solution that drives the actual iPhone UI. • It is modelled after the very popular RSpec for Ruby. • Written in Objective C
  • 21.
    -(void)itShouldHaveDefaultUsers {        //Check that all default users are in list         [[app.tableView.label text:@"Larry Stooge"] should].exist;         [[app.tableView.label text:@"Curly Stooge"] should].exist;         [[app.tableView.label text:@"Moe Stooge"] should].exist; }
  • 22.
  • 23.
    Cucumber • Cucumber isa tool that executes plain-text functional descriptions as automated tests.
  • 24.
    Cucumber • Cucumber isa tool that executes plain-text functional descriptions as automated tests. • Written in Ruby
  • 25.
    Cucumber • Cucumber isa tool that executes plain-text functional descriptions as automated tests. • Written in Ruby • Created originally for use with Ruby on Rails.
  • 26.
    Cucumber • Cucumber isa tool that executes plain-text functional descriptions as automated tests. • Written in Ruby • Created originally for use with Ruby on Rails. • Command line tool
  • 27.
    Cucumber • Cucumber isa tool that executes plain-text functional descriptions as automated tests. • Written in Ruby • Created originally for use with Ruby on Rails. • Command line tool • Written specifically for BDD
  • 28.
    Feature: Search courses In order to ensure better utilization of courses Potential students should be able to search for courses Scenario: Search by topic Given there are 240 courses which do not have the topic "biology" And there are 2 courses A001, B205 that each have "biology" as one of the topics When I search for "biology" Then I should see the following courses: | Course code | | A001 | | B205 |
  • 30.
  • 31.
    Resources • https://github.com/moredip/Frank • https://github.com/aslakhellesoy/cucumber •http://www.melbournecocoaheads.com/ testing-ios-apps-with-frank-slides-and- videos/
  • 32.
    @keithpitt Thanks for your attention