UIAutomation for iOS Introduction

30
Photograph by Simon Abrams / https://www.flickr.com/photos/flysi/183272970/ UIAutomation for iOS Introduction @kuronekomichael

description

4月18日のObj-C&Xcode開発周り勉強会 - 0x01での発表資料です。 http://www.zusaar.com/event/5027005

Transcript of UIAutomation for iOS Introduction

Page 1: UIAutomation for iOS Introduction

Photograph by Simon Abrams / https://www.flickr.com/photos/flysi/183272970/

UIAutomationfor iOS

Introduction

@kuronekomichael

Page 2: UIAutomation for iOS Introduction

Agenda

•1. なぜいま結合テストの自動化?•2. Instrumentsの紹介•3. 注意とアドバイス•4. これからのオートメーション

Page 3: UIAutomation for iOS Introduction

なぜいま結合テストの自動化?

• ・iOSバージョン  iOS5  iOS6  iOS7

• ・端末 3.5inch 4inch iPad iPod Touch..

• ・開発プロセス  ウォーターフォール    ↓  アジャイル

Page 5: UIAutomation for iOS Introduction

XCode Instruments• ・XCode付属の開発ツール• ・メモリリーク検出• ・CPUリソースの監視• ・ボトルネック検出のためのプロファイリング• ・ファイルシステムへのアクセスを監視

Page 6: UIAutomation for iOS Introduction

UIAutomation• ・Instrumentsの中の一機能• ・アプリの自動テストをサポートする• ・ユーザ操作をレコーディングして JavaScriptのコードとして出力

• ・JavaScriptのコードを元に、 ユーザ操作を再現するように再生する

Page 7: UIAutomation for iOS Introduction

Instruments

Page 8: UIAutomation for iOS Introduction
Page 9: UIAutomation for iOS Introduction
Page 10: UIAutomation for iOS Introduction

/Users/<ユーザ名>/Library/Application Support/iPhone Simulator/<シミュレータのバージョン>/Applications/<アプリのバンドルID>/<アプリ名>.app

Page 11: UIAutomation for iOS Introduction
Page 12: UIAutomation for iOS Introduction

AppName.app

Page 13: UIAutomation for iOS Introduction

AppName.app

Page 14: UIAutomation for iOS Introduction

AppName.app

Page 15: UIAutomation for iOS Introduction

AppName.app

Page 16: UIAutomation for iOS Introduction

AppName.app

Page 17: UIAutomation for iOS Introduction

スクリプトの保存

•スクリプトエリアの右クリック(セカンダリータップ)からスクリプトの保存(Export)が可能

Page 18: UIAutomation for iOS Introduction

エディタ⇔トレース画面の切り替え AppName.app

AppName.app

Page 19: UIAutomation for iOS Introduction

Photograph by Simon Abrams / https://www.flickr.com/photos/flysi/183272970/

デモdemonstration

Page 20: UIAutomation for iOS Introduction

Photograph by Simon Abrams / https://www.flickr.com/photos/flysi/183272970/

注意とアドバイスattention and advice

Page 21: UIAutomation for iOS Introduction

注意とアドバイス

•・操作記録は、たたき台の生成に近い 手修正がほぼ必須

• ・ログメソッドを使いこなす• UIAElement logElement()• UIAElement logElementTree()• ・日本語資料少ない• ・慣れてきたら編集<=>CLIで実行の方が スムーズかも

Page 22: UIAutomation for iOS Introduction

https://gist.github.com/kuronekomichael/11032775

CLIから実行するシェルを公開してます(参考用)

Page 23: UIAutomation for iOS Introduction

APIドキュメント

https://gist.github.com/kuronekomichael/11032094

APIリファレンスをざっくり日本語訳しました(怒られたら消します)

Page 24: UIAutomation for iOS Introduction

Photograph by Simon Abrams / https://www.flickr.com/photos/flysi/183272970/

これからの結合テストfuture of testing

Page 26: UIAutomation for iOS Introduction
Page 27: UIAutomation for iOS Introduction

appium•

Page 28: UIAutomation for iOS Introduction
Page 30: UIAutomation for iOS Introduction

Photograph by Simon Abrams / https://www.flickr.com/photos/flysi/183272970/

thanx!御清聴ありがとうございました