I os ui test automation

14
Автоматическое тестирование UI в iOS Виктор Петренко [email protected] CTO songsterr.com

description

 

Transcript of I os ui test automation

Page 1: I os ui test automation

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

Виктор Петренко [email protected]

CTO songsterr.com

Page 2: I os ui test automation

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

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

FoneMonkey)

● zucchini framework● UI Automation

Page 3: I os ui test automation

UI Automation

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

Page 4: I os ui test automation

Songsterr App

Page 5: I os ui test automation

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;

Page 6: I os ui test automation

Songsterr App (iPad)

Page 7: I os ui test automation

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);

Page 8: I os ui test automation

openPopular (MainScreen.js)

openPopular: function() {

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

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

} else {

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

}

},

// ...

Page 9: I os ui test automation

assertScreenMatchesImageNamed

Page 10: I os ui test automation

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

var objectProp =

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

assertTableViewList

Page 11: I os ui test automation

accessibilityValue

@implementation UIImageView (Automation)

- (NSString *)accessibilityValue

{

//..

return [NSString stringWithFormat:

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

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

}

Page 12: I os ui test automation

UI Automation Pros & Cons

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

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

Page 13: I os ui test automation

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

● 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

Page 14: I os ui test automation

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

Виктор Петренко [email protected]

songsterr.com