• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Ui BDD Testing
 

Ui BDD Testing

on

  • 2,939 views

Overview of UI testing tools for iOS, specially Cucumber

Overview of UI testing tools for iOS, specially Cucumber

Statistics

Views

Total Views
2,939
Views on SlideShare
2,915
Embed Views
24

Actions

Likes
3
Downloads
34
Comments
0

4 Embeds 24

http://yana.hatenablog.com 15
http://www.linkedin.com 4
https://www.linkedin.com 3
http://a0.twimg.com 2

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Модульное тестирование — процесс в программировании, позволяющий проверить на корректность отдельные модули исходного кода программы.\nИдея состоит в том, чтобы писать тесты для каждой нетривиальной функции или метода. Это позволяет достаточно быстро проверить, не привело ли очередное изменение кода к регрессии, то есть к появлению ошибок в уже оттестированных местах программы, а также облегчает обнаружение и устранение таких ошибок.\n
  • - try it out, press a few buttons (perhaps even mail it to the user)\n- it seems to be working => nothing is obviously broken\n* not as strong a statement (try sending that to a client)\n- manual testing takes too long\n
  • - try it out, press a few buttons (perhaps even mail it to the user)\n- it seems to be working => nothing is obviously broken\n* not as strong a statement (try sending that to a client)\n- manual testing takes too long\n
  • - try it out, press a few buttons (perhaps even mail it to the user)\n- it seems to be working => nothing is obviously broken\n* not as strong a statement (try sending that to a client)\n- manual testing takes too long\n
  • \n
  • \n
  • TOOLS FOR - actually remote controlling your app (like Selenium or WebDriver)\nSikuli - uses image analysis (fragile?)\n- simulator only unless you jailbreak your phone and run a VNC server on it\nFoneMonkey - comes from a record/playback model (does have scripting now)\niCuke - very similar to Frank but uses XML/xpath\n- pushes more work to the Ruby side, very little Objective C logic\n- potentially lead to brittle tests as XML structure more likely to change?\n- more “touch at X Y” kind of tests\nUIAutomation - Instruments + javascript + jasmine-iphone\n- could not consistently run and automate in the build, no applescript\n
  • TOOLS FOR - actually remote controlling your app (like Selenium or WebDriver)\nSikuli - uses image analysis (fragile?)\n- simulator only unless you jailbreak your phone and run a VNC server on it\nFoneMonkey - comes from a record/playback model (does have scripting now)\niCuke - very similar to Frank but uses XML/xpath\n- pushes more work to the Ruby side, very little Objective C logic\n- potentially lead to brittle tests as XML structure more likely to change?\n- more “touch at X Y” kind of tests\nUIAutomation - Instruments + javascript + jasmine-iphone\n- could not consistently run and automate in the build, no applescript\n
  • TOOLS FOR - actually remote controlling your app (like Selenium or WebDriver)\nSikuli - uses image analysis (fragile?)\n- simulator only unless you jailbreak your phone and run a VNC server on it\nFoneMonkey - comes from a record/playback model (does have scripting now)\niCuke - very similar to Frank but uses XML/xpath\n- pushes more work to the Ruby side, very little Objective C logic\n- potentially lead to brittle tests as XML structure more likely to change?\n- more “touch at X Y” kind of tests\nUIAutomation - Instruments + javascript + jasmine-iphone\n- could not consistently run and automate in the build, no applescript\n
  • TOOLS FOR - actually remote controlling your app (like Selenium or WebDriver)\nSikuli - uses image analysis (fragile?)\n- simulator only unless you jailbreak your phone and run a VNC server on it\nFoneMonkey - comes from a record/playback model (does have scripting now)\niCuke - very similar to Frank but uses XML/xpath\n- pushes more work to the Ruby side, very little Objective C logic\n- potentially lead to brittle tests as XML structure more likely to change?\n- more “touch at X Y” kind of tests\nUIAutomation - Instruments + javascript + jasmine-iphone\n- could not consistently run and automate in the build, no applescript\n
  • TOOLS FOR - actually remote controlling your app (like Selenium or WebDriver)\nSikuli - uses image analysis (fragile?)\n- simulator only unless you jailbreak your phone and run a VNC server on it\nFoneMonkey - comes from a record/playback model (does have scripting now)\niCuke - very similar to Frank but uses XML/xpath\n- pushes more work to the Ruby side, very little Objective C logic\n- potentially lead to brittle tests as XML structure more likely to change?\n- more “touch at X Y” kind of tests\nUIAutomation - Instruments + javascript + jasmine-iphone\n- could not consistently run and automate in the build, no applescript\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • - linking up a handful of open source tools to create a monster\n\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • iOS testing tool that uses UISpec's UIScript to remotely drive an App\n
  • - BDD tool modelled on RSpec\n- useful tool, not a huge community about it\n- uses a query language called UIQuery\n- difficult to run as part of a CI build (Perryn)\n- output hard to read\n- not business readable\n
  • \n
  • - describe the behavior of the app in plain English\n- business readable\n-> think at a higher level\n
  • \n
  • \n
  • \n
  • \n
  • - symbiote: talk to a running app interactively\n- view DOM & accessibility label\n- flash element\n- write the most general selector possible (less brittle tests)\n
  • \n
  • \n
  • \n
  • \n

Ui BDD Testing Ui BDD Testing Presentation Transcript

  • UI Testing Taras Kalapun 1
  • “It seems tobe working”
  • “Nothing isobviously broken”
  • Why Create Automated Tests?• Find bugs while you sleep• Repeatable regressions tests• Quickly turn around updates to your application 3
  • 4
  • Potential Testing Tools hmmm... 5
  • Potential Testing Tools• Frank and UISpec hmmm... 5
  • Potential Testing Tools• Frank and UISpec hmmm...• Sikuli 5
  • Potential Testing Tools• Frank and UISpec hmmm...• Sikuli• FoneMonkey 5
  • Potential Testing Tools• Frank and UISpec hmmm...• Sikuli• FoneMonkey• iCuke 5
  • Potential Testing Tools• Frank and UISpec hmmm...• Sikuli• FoneMonkey• iCuke• UIAutomation 5
  • UI Automation 6
  • 7
  • 8
  • Loggingvar testName = "My first test";UIALogger.logStart(testName); // test codeUIALogger.logPass(testName); 9
  • test("Food screen", function(target, app) { var window = app.mainWindow(); window.tabBars()[0].buttons()["Food"].tap(); var e; // Choose Provider e = window.tableViews()[0].cells()[0]; waitVisible(e); e.tap(); delay(1); // Choose food e = window.tableViews()[0].cells()[0]; waitVisible(e); e.tap(); delay(1); // Put in basket e = window.tableViews()[0].cells()[0]; waitVisible(e); e.tap(); 10
  • 11
  • test("User Info screen", function(target, app) { var window = app.mainWindow(); var tabBar = window.tabBars()[0]; tabBar.buttons()["Info"].tap(); var tableView = window.tableViews()[0]; // Choose User Info waitVisible(tableView.cells()["User Info"]); tableView.cells()["User Info"].tap(); //textFields()[0].setValue(name); tableView = window.tableViews()[0]; tableView.cells()["name"].textFields()[0].setValue("Vasya"); tableView.cells()["email"].textFields()[0].setValue("test@example.com"); tableView.cells()["phone"].textFields()[0].setValue("+77777"); }); 12
  • Handling Alerts UIATarget.onAlert = function onAlert(alert) { var title = alert.name(); UIALogger.logWarning("Alert with title " +title + " encountered!"); if (title == "Warning") { alert.buttons()["OK"].tap(); return true; // bypass default handler } return false; // use default handler } 13
  • Multitasking • Deactivate application for a given time • Reactivating the application is handled automaticallyUIALogger.logMessage("Deactivating app");UIATarget.localTarget().deactivateAppForDuration(10);UIALogger.logMessage("Resuming test afterdeactivation"); 14
  • + ? describe("Jasmine", function() { it("makes testing JavaScript awesome!", function() { expect(yourCode).toBeLotsBetter(); }); });• http://pivotal.github.com/jasmine/• https://github.com/dexterous/iOS-Acceptance-Testing 15
  • 16
  • Record/playback functional testing tool • Records high-level user actions • Integrates with OCUnit • Generation of OCUnit test scripts • Generation of JavaScript UIAutomation scripts • Validation commandshttp://www.gorillalogic.com/fonemonkey 17
  • 18
  • Zucchini 19
  • Frank and Cucumber20
  • Tests iPhone App 21
  • Tests UISpec Cucumber / Ruby ? iPhone App 21
  • Tests Frank Server UISpec Cucumber / Ruby iPhone App 21
  • Tests Frank Driver Frank Server UISpec Cucumber / Ruby iPhone App 21
  • Tests Frank Driver Frank Server “frankly” UISpec Cucumber / Ruby iPhone App 21
  • UISpecUISpec is a Behavior Driven Development frameworkfor the iPhone that provides a full automated testingsolution that drives the actual iPhone UI http://code.google.com/p/uispec/ 22
  • UIScript$(@"textField with placeholder:UsernamesetText:bkuser");$(@"textField with placeholder:PasswordsetText:bkpassword");$(@"navigationButton label with text:Login touch"); 23
  • Scenario: [name of the scenario] Given [some statement] When [some action] Then [some expected result] And [another expectation] 24
  • Feature: Browsing catalog In order to test catalog browsing As a user I want be able to browsethrough catalog entries 25
  • CucumberFeature: Buying shoes Background: The app is running Given I launch the app Scenario: Placing an order on shoes When I open catalog And I switch to "Categories" view And I pick "Женская обувь" category And I pick "Босоножки" subcategory And I pick "Босоножки женские Lloyd" item And I buy the item Then I should see "1049.4" price badge 26
  • When /^I wait ([d.]+) second(?:s)?$/ do |seconds| seconds = seconds.to_f sleep( seconds )endThen /^I should see several entires in the table$/ do section = 0 expected_num_rows = 2 num_rows_array = frankly_map( "tableView first","numberOfRowsInSection:", section ) raise "no table found" if num_rows_array.empty? num_rows_array.first.should > expected_num_rowsend 27
  • When /^I pick "([^"]*)" item$/ do |item| steps %Q{ When I wait to see "#{item}" And I touch the 3rd table cell }endWhen /^I buy the item$/ do frankly_map("scrollView first scrollDown:220", "") touch "view marked:Buy"end 28
  • 29
  • 30
  • robotium31
  • 32
  • Refs• http://github.com/moredip/frank• http://cuke4ninja.com• http://cukes.info• http://www.slideshare.net/sgleadow/frank-ios-testing• http://www.slideshare.net/sgleadow/agile-ios• http://stackoverflow.com/questions/4114083/ios-tests-specs- tdd-bdd-and-integration-acceptance-testing• kiwi - BDD Logick test 33