際際滷

際際滷Share a Scribd company logo
Mark	Chang	-	y_l何 
iOS	UIAutomation
?? Introduction	
C? UIAutomation	testing	
?? iOS	Accessibility	
?? Development	Tools	
C? Environment	
C? Instruments	
C? Tuneup	JS	Library	
?? Q		A	
	
Outline
?? Some	software	testing	is	´	
C? Boring	
C? Routine	
?? So	we	need	an	automation	testing	tool	!
UIAutomation	testing
1.? User's	view	
C? For	blind	users.	
2.? Engineer's	view	
C? For	UIAutomation	testing.	
C? Maybe	shows	inside	information	of	system.	
iOS	Accessibility
?? 	 	 	VoiceOver
iOS	Accessibility
?? Set	element	accessibility	
?? Set	element	traits	
iOS	Accessibility	in	iOS	code
Identity	inspector
Demo
?? Hardware	
C? Mac	
C? iDevice	(iPhone,	iPad,	iPod)	
?? Software	
C? Xcode	(version	5.1)	
C? Sublime	Text	2	(optional)	
Development	environment
?? Instruments	is	a	performance,	analysis,	and
	testing	tool	for	dynamically	tracing	and
	profiling	OS	X	and	iOS	code.	
Instruments
?? Automation	
C? Perform	automated	tests	on	real	devices	and	on
	iPhone	Simulator.	
C? Strong	relationship	between	Accessibility	and
	UIAutomation.	
C? JavaScript	language.	
Instruments
Instruments
UIButton
UIButton
?? Click	on	the	screen	
?? Click	a	button	
Instruments
accessibilityLabel
?? UIALogger	
C? logMessage():	Logs	the	specified	message.	
C? logPass():	Logs	a	message	and	indicates	a	test	has
	completed	successfully.	
C? logFail():	Logs	a	message	and	indicates	a	test	has
	completed	unsuccessfully.	
Instruments
?? It	improves	the	UIAutomation	library	provided
	by	Apple	for	testing	iOS	applications	via
	Instruments.	
?? JavaScript	language.	
Tuneup	JS	Library
?? test	function	in	test.js		
?? assert	functions	in	assertions.js	
?? Example:	
Tuneup	JS	Library
assertEquals	function
?? If	you	want	to	automate	your	scripts,	you	can
	launch	them	from	the	command	line.		
Tuneup	JS	Library
example
command
?? Using	The	Built-in	Test	Runner.		
Tuneup	JS	Library
command
example
Test	Case	Automation	Ratio
y宛箭e 徭啝y宛箭 y宛箭 徭啝曳楕
01. 鞠秘 10
 10
 100.0	%
02. 梧爆双燕 14
 15
 93.9	%
03. 梧返 Y中 0
 14
 0	%
04. 殴慧孔嬬 12
 14
 85.7	%
05. 貧朴 0
 21
 0	%
06. 貧娼x 0
 12
 0	%
07. O協 5
 7
 71.4	%
08. 厘議咄 0
 8
 0	%
09. 匯軟 0
 10
 0	%
10. 匯c髢 46
 46
 100.0	%
栽 87
 157
 55.4	%
?? Instruments	User	Guide:	About	Instruments	
C? https://developer.apple.com/library/mac/documentation/developertools
/conceptual/instrumentsuserguide/Introduction/Introduction.html	
?? UI	Automation	JavaScript	Reference	
C? https://developer.apple.com/library/ios/documentation/DeveloperTools
/Reference/UIAutomationRef/_index.html	
?? iOS	Automated	Tests	with	UIAutomation		
C? http://blog.manbolo.com/2012/04/08/ios-automated-tests-with-uiautomation	
?? Tuneup	JS	
C? http://www.tuneupjs.org/	
C? https://github.com/alexvollmer/tuneup_js	
Reference
Q		A
Thank	You

More Related Content

iOS UIAutomation