I os ui test automation

Post on 28-Nov-2014

708 views 1 download

description

 

Transcript of I os ui test automation

Автоматическое тестирование UI в iOS

Виктор Петренко vpetrenko@gmail.com

CTO songsterr.com

Обзор решений

● Frank (UISpec)● KIF● Calabash● appium.io● Monkey Talk (ex.

FoneMonkey)

● zucchini framework● UI Automation

UI Automation

● Tuneup JS● mechanic.js● UIAutoMonkey● bwoken● choose_sim_device

Songsterr App

songs_screen.js

var SongsScreen = {

tableView: function() {

if (this.target().isDeviceiPhone())

return this.window().tableViews()[0];

else

return

MainScreen.navigationView().tableViews()[0];

}

},

SongsScreen.__proto__ = GenericScreen;

Songsterr App (iPad)

test_catalog.jstest("Change catalog screens", function(target, app) {

MainScreen.openPopular();

if (isStandalone()) {

assertScreenMatchesImageNamed("popular", "popular screen doesn't match");

}

SongsScreen.assertTableViewList("http://<...>/songs/popular.json", SongsScreen.createSongName);

openPopular (MainScreen.js)

openPopular: function() {

if (this.target().isDeviceiPhone()) {

this.searchWithName("icon_popular").tap();

} else {

this.searchWithName("Tab button: 0").tap();

}

},

// ...

assertScreenMatchesImageNamed

● performTaskWithPathArgumentsTimeout● Неявные ограничения на ответ

var objectProp =

eval("(" + object.value() + ")");

assertTableViewList

accessibilityValue

@implementation UIImageView (Automation)

- (NSString *)accessibilityValue

{

//..

return [NSString stringWithFormat:

@"{'hidden':%@}",

isHidden ? @"true" : @"false"];

}

UI Automation Pros & Cons

Pros● Apple (recommended way)● Gestures● Simulator/Hardware

Cons● Не open source● Бедная инфраструктура

Интересные ссылки

● http://blog.manbolo.com/2012/04/08/ios-automated-tests-with-uiautomation

● Test iOS Apps with UI Automation by Jonathan Penn

● Facebook: rostov.iOS.dev

Вопросы?Автоматическое тестирование UI в iOS

Виктор Петренко vpetrenko@gmail.com

songsterr.com