Submit Search
Cocoa勉強会201203公開
Download as KEY, PDF
3 likes
1,804 views
Satoshi Oomori
Cocoa勉強会 2012年3月24日大森分UIテストの自動化
Technology
Read more
1 of 94
Download now
Downloaded 16 times
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
More Related Content
PDF
クラウド移住で地方に住むということ
Takehito Tanabe
PPT
Artificial glacier
INDIA
PDF
Watershed management
Shrikant Jahagirdar
PPTX
Rainwater harvesting and watershed management
Pranay Krishnan
PPTX
Rain water harvesting ppt
Palash Jain
PPTX
Presentation watershed
akshitakohli
KEY
Cocoa勉強会関西2012年5月
Satoshi Oomori
PDF
Unity 5.3 の In-App Purchase を試してみた
Mori Tetsuya
クラウド移住で地方に住むということ
Takehito Tanabe
Artificial glacier
INDIA
Watershed management
Shrikant Jahagirdar
Rainwater harvesting and watershed management
Pranay Krishnan
Rain water harvesting ppt
Palash Jain
Presentation watershed
akshitakohli
Cocoa勉強会関西2012年5月
Satoshi Oomori
Unity 5.3 の In-App Purchase を試してみた
Mori Tetsuya
More from Satoshi Oomori
(8)
PDF
Cocoa勉強会20140621 macとiosで共通のコード
Satoshi Oomori
PDF
Cocoa勉強会20140419ゲームをつくってみる
Satoshi Oomori
PDF
Word net cocoa勉強会201306
Satoshi Oomori
PDF
Scene kit cocoa勉強会201306
Satoshi Oomori
PDF
Cocoa勉強会ビギナーズramディスクとコマンドファイル
Satoshi Oomori
PPT
Cocoa勉強会201302
Satoshi Oomori
KEY
Cocoa勉強会201208
Satoshi Oomori
PDF
Cocoa勉強会2011年11月
Satoshi Oomori
Cocoa勉強会20140621 macとiosで共通のコード
Satoshi Oomori
Cocoa勉強会20140419ゲームをつくってみる
Satoshi Oomori
Word net cocoa勉強会201306
Satoshi Oomori
Scene kit cocoa勉強会201306
Satoshi Oomori
Cocoa勉強会ビギナーズramディスクとコマンドファイル
Satoshi Oomori
Cocoa勉強会201302
Satoshi Oomori
Cocoa勉強会201208
Satoshi Oomori
Cocoa勉強会2011年11月
Satoshi Oomori
Ad
Cocoa勉強会201203公開
1.
UIテストの自動化 UIAutomationを使って
2012.3.24 Cocoa勉強会 大森智史(@oogon)
2.
あんた、誰?
3.
と、いうことで...
4.
ごあいさつ
5.
ごあいさつ • 大森智史(おおもり さとし)です。
6.
ごあいさつ • 大森智史(おおもり さとし)です。 • Objective-C書いて遊んでます。
8.
• というとこで、ICカードとか売ってま す。(システムまるごと)
9.
• というとこで、ICカードとか売ってま す。(システムまるごと) •
iPhoneもそろそろNFCとか来そうだし
10.
• というとこで、ICカードとか売ってま す。(システムまるごと) •
iPhoneもそろそろNFCとか来そうだし • 何か案件があれば、どうぞ!
11.
挨拶終わり
12.
では、本題。
13.
本日の内容
14.
本日の内容 • iOSのUIテストの自動化の説明します。
15.
本日の内容 • iOSのUIテストの自動化の説明します。 • どのようにするかの方法を説明します。
16.
本日の内容 • iOSのUIテストの自動化の説明します。 • どのようにするかの方法を説明します。
スライド、サンプルは後ほどSlidShareとGithubに置きます。
27.
テストしましょう!
28.
インターフェースの • どうやってますか? • 自分でボタン押して...スライドして...ボ
タン押して...
29.
面倒ですね
30.
面倒な作業は Macに
32.
そこで
33.
どうするの?
34.
コードを書きます
35.
どんな?
36.
JavaScript!
37.
こんな感じ!
38.
どこに?
39.
Instrument! • iOS 5からはコマンドラインからも使える
らしい。
40.
作り方 • XcodeからProfile実行 • Automationモジュールを選択
41.
• Script >
Add
42.
• Create • Scriptエディタ
に書いていき ます
43.
• 自動記録もできます。 仮の名前になるので、後で修正するべし。
44.
どんなことが
45.
1.ボタン押したり タッチ、スライド、 ピンチ
など
46.
2.オブジェクトが 何個あるかの検証
47.
3.テストが成功した か失敗したかの記録
48.
4.GPSなどの現在地
が 変更できます。
49.
もう、京阪デバッグ
とは おさらばだ!
50.
5.指定サイズのスク リーンショット。
51.
6.音量調節。
52.
どんなふうに 書くの?
53.
まず最初
54.
//変数targetにデバッグターゲットをセット var target = UIATarget.localTarget(); //ログ記録開始 UIALogger.logStart("テストスタート Starting
Test:"+ target.model());
55.
オブジェクトを 変数にいれとく
56.
//変数viewに現在のメインウインドウを セット var view = UIATarget.localTarget().frontMost App().mainWindow();
57.
位置の セット
58.
//現在の位置をセット target.setLocationWithOptions( {latitude: 35.029500,longitude: 135.772700}, {horizontalAccuracy:10.0, altitude:20.0});
59.
画面撮影
60.
//画面を撮影 target.captureScreenWithName("loc ation3");
61.
音量下げる
62.
//音量下げる target.clickVolumeDown();
63.
ドラッグ
64.
//指定位置でドラッグ target.dragFromToForDuration({x: 15, y:114}, {x:150,
y:114}, 5);
65.
デバイスの向き変更
66.
//デバイスの向きを変える target.setDeviceOrientation(UIA_D EVICE_ORIENTATION_LANDSCAPERIGHT) ;
67.
判定
68.
//判定 if (textfields.length !=
0) { UIALogger.logFail("ERROR"); } else { UIALogger.logPass("OK"); }
69.
UIAutomationのリ ファレンスをみれば もっといろいろあり
ます。
70.
ターゲット
71.
iPhoneシミュレータ iPadシミュレータ
実機
72.
テストを 実行するには?
73.
Recordで実行します
74.
1つ注意点!
75.
コードを修正して 普通にビルドしても 古いアプリケーション
76.
プロジェクトの修正 をしたら...
77.
Build for Profiling! これで実行される アプリケーションが
78.
Build for Profiling! これで実行される アプリケーションが
79.
大事なので もう一度
80.
Build for Profiling!
81.
Build for Profiling!
82.
それではDEMO
83.
DEMO
84.
まとめ1
85.
まとめ1 • XcodeでProfileを実行。Automationモジュール。
86.
まとめ1 • XcodeでProfileを実行。Automationモジュール。 • JavaScriptを書きます。UIAutomation参照。
87.
まとめ1 • XcodeでProfileを実行。Automationモジュール。 • JavaScriptを書きます。UIAutomation参照。 •
ターゲット別にテスト可能。
88.
まとめ2
89.
まとめ2 • UIパーツがどういう状態かを知ることができる
90.
まとめ2 • UIパーツがどういう状態かを知ることができる • 位置情報、向きなどデバイスの状態を変更できる
91.
まとめ2 • UIパーツがどういう状態かを知ることができる • 位置情報、向きなどデバイスの状態を変更できる •
忘れないで! Build for Profiling
92.
ありがとう
93.
何か質問など?
94.
ありがとう
Editor's Notes
#2:
\n
#3:
\n
#4:
\n
#5:
\n
#6:
\n
#7:
\n
#8:
\n
#9:
\n
#10:
\n
#11:
\n
#12:
\n
#13:
\n
#14:
\n
#15:
\n
#16:
\n
#17:
\n
#18:
\n
#19:
\n
#20:
\n
#21:
\n
#22:
\n
#23:
\n
#24:
\n
#25:
\n
#26:
\n
#27:
\n
#28:
\n
#29:
\n
#30:
\n
#31:
\n
#32:
\n
#33:
\n
#34:
\n
#35:
\n
#36:
\n
#37:
\n
#38:
\n
#39:
\n
#40:
\n
#41:
\n
#42:
\n
#43:
\n
#44:
\n
#45:
\n
#46:
\n
#47:
\n
#48:
\n
#49:
\n
#50:
\n
#51:
\n
#52:
\n
#53:
\n
#54:
\n
#55:
\n
#56:
\n
#57:
\n
#58:
\n
#59:
\n
#60:
\n
#61:
\n
#62:
\n
#63:
\n
#64:
\n
#65:
\n
#66:
\n
#67:
\n
#68:
\n
#69:
\n
#70:
\n
#71:
\n
#72:
\n
#73:
\n
#74:
\n
#75:
\n
#76:
\n
#77:
\n
#78:
\n
#79:
\n
#80:
\n
#81:
\n
#82:
\n
#83:
\n
#84:
\n
Download