19. 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
20. 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
21. Multitasking
• Deactivate application for a given time
• Reactivating the application is handled
automatically
UIALogger.logMessage("Deactivating app");
UIATarget.localTarget().deactivateAppForDuration(10);
UIALogger.logMessage("Resuming test after
deactivation");
14
30. Tests Frank
Server
UISpec
Cucumber / Ruby
iPhone
App
21
31. Tests Frank
Driver
Frank
Server
UISpec
Cucumber / Ruby
iPhone
App
21
32. Tests Frank
Driver
Frank
Server
“frankly”
UISpec
Cucumber / Ruby
iPhone
App
21
33. UISpec
UISpec is a Behavior Driven Development framework
for the iPhone that provides a full automated testing
solution that drives the actual iPhone UI
http://code.google.com/p/uispec/
22
35. Scenario: [name of the scenario]
Given [some statement]
When [some action]
Then [some expected result]
And [another expectation]
24
36. Feature: Browsing catalog
In order to test catalog browsing
As a user
I want be able to browse
through catalog entries
25
37. Cucumber
Feature: 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
38. When /^I wait ([d.]+) second(?:s)?$/ do |seconds|
seconds = seconds.to_f
sleep( seconds )
end
Then /^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_rows
end
27
39. When /^I pick "([^"]*)" item$/ do |item|
steps %Q{
When I wait to see "#{item}"
And I touch the 3rd table cell
}
end
When /^I buy the item$/ do
frankly_map("scrollView first scrollDown:220", "")
touch "view marked:'Buy'"
end
28
- 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