O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
Automation Testing

using Cucumber + Calabash on android

Frances Lin
QA Engineer @ Omlet Inc.
Agenda

= I= Introduction about "Testing” and “Automation”
1: Why automation is important
at Automation tools:  Cucumber *...
E
': 
'l
I
_c
. ~
5
: 
3

Calabash

Automated acceptance testing for mobile at

Calabash enables you to write and execute ...
Testing

= I= Unit test

= I= With a very narrow and well defined scope,  mostly done by developer

at Integration test

as...
Why Automation? 

at Fast is important,  but what fast really means? 
at — done need to be without obvious issues
at There...
Cucumber

* Main Components
4: Scenarios,  user behavior driven tests

as Steps,  combine mobile operation and logic

as "...
Calabash

= I= The underlying low—level libraries that empower
the Cucumber

= I= Provide low—| eve|  APIs,  to control or...
let's try!
How to implement? 

as Prepare your test case

at Write test cases into scenarios using Cucumber
as Implement scenarios wi...
Preconditions

Should install Omlet chat on the mobile device. 

U)
at
(D
‘U
U! 

Login Omlet chat on the mobile device

E...
Then

I leave the chat room$/ 
tap_when_element_exists(“x
tap_when_element_existsl"*
sleepl )
wait_for_element_exists("*

...
l l .  -blurs

    

   

ll:  tin ed*2_ lIllI'IIOI'll(9)% um n: (-I
' an  u: uru; :erie a " mun’ n" f ’&{”. m R
i run 5' ...
’ .  I’
l. -l .  iim-V l]. llll1*'. it| l(l pr-ill) 0 . 
7  4liniiliigl, lltI| lc'ligi: ‘.‘

automation 0

Automation. ..
Frances ...
Android Action
—Pan

'1‘ #pan(query_string, 
direction,  options =  {})
= > Object

Dani .  )
tap_when_element_exists(
sle...
( Automation Drawerapps

Android Action
— long press

  

.  4
is xiii? 

You joined. 

 

‘I’ #1ong_press_when_e1e
ment_e...
Android Action
— enter text

‘= ° #enter_text(uiquery, 

text,  options =  {}) = >
Object

text_message
enter text(

  
 
...
Android Action -
long press and  

slide up *3  *

      
 

lLriu, .

0 4» Premier League

5 Puiii'. ~iuiv

4‘ long press...
The most important part
of testing

 

9;
W C 0
Verification

as verify the element appears

= i= await_for, e|ement_existsluiquery options =  O)
:  Object

= i= verify th...
Verification

 

= i= pan until the

element exists ,  j d ; ;;; :

as euntil_element_ X 9  0
existsluiquery,  - 
opts =  O...
Keport

3|: 

I Then Italic a screenshot named 'rrIl| u_stI<ker_| m|g: '

N Then I share a ‘Imago’

shared image 16 Dfig

...
THANK vou

Now you can do testing wifh calabash! 
lfyou’reim‘eres1‘inqin Omlet welcome ’ro join us : )

Google search:  ” ...
Próximos SlideShares
Carregando em…5
×

21

Compartilhar

Baixar para ler offline

Automation Testing: using Cucumber + Calabash on Android Apps

Baixar para ler offline

Presentation @ Android Taipei

Audiolivros relacionados

Gratuito durante 30 dias do Scribd

Ver tudo

Automation Testing: using Cucumber + Calabash on Android Apps

  1. 1. Automation Testing using Cucumber + Calabash on android Frances Lin QA Engineer @ Omlet Inc.
  2. 2. Agenda = I= Introduction about "Testing” and “Automation” 1: Why automation is important at Automation tools: Cucumber * Calabash = I= How to use Cucumber and Calabash to implement Android automation testing = I= Vemo
  3. 3. E ': 'l I _c . ~ 5 : 3 Calabash Automated acceptance testing for mobile at Calabash enables you to write and execute automated ac mobile apps. It's cross-platform, supporting Android and It's also open source and free, developed and maintained Featu . Irutlal experience As. a user 1 mm a helpful om: Slfllple mural Experience with the app‘ I should be able to get help and logln to an exlsllng won-dvress sue. Druinstoll Sconarlo: Uatalmng more lnfcr-mtlon Scenarlo: (rents nem account <———~—. —~l_-J1_»«, o—. _L— ~. ',: :<_L~—. v.~
  4. 4. Testing = I= Unit test = I= With a very narrow and well defined scope, mostly done by developer at Integration test as Test the correct inter—o eration of multiple subsystems. Mostly test on client side interface —— like A Is, Mobile or Web apps at Kegression test at Test for the whole spec, to make sure the application provides the same outcome.
  5. 5. Why Automation? at Fast is important, but what fast really means? at — done need to be without obvious issues at There are too many places to test - Have you ever fix the A issue and break the B feature? — ”SUKE VIP ” = i= Using Cucumber + Calabash to handle the Integration / Regression test
  6. 6. Cucumber * Main Components 4: Scenarios, user behavior driven tests as Steps, combine mobile operation and logic as "Cucumber lets you express the behavior of your app using natural language that can be understood by business experts and non—technical QA staff. ” as The human collaboration = I= Earlier to mapping with real test cases as Creat readable automation report
  7. 7. Calabash = I= The underlying low—level libraries that empower the Cucumber = I= Provide low—| eve| APIs, to control or simulate mobile operation at Kuby based as Cross—platform mobile testing tool at lleveloped and maintained by Xamarin
  8. 8. let's try!
  9. 9. How to implement? as Prepare your test case at Write test cases into scenarios using Cucumber as Implement scenarios with step definition at llun test as Output Kesult
  10. 10. Preconditions Should install Omlet chat on the mobile device. U) at (D ‘U U! Login Omlet chat on the mobile device Expand left navigation Click Chats tab from Menu section Click + icon from right-top corner Click OK button directly Verify the chat room is created and you have joined the chat room Click < Back icon Verify the page returns back to Chats page 9°. '. °‘. ”': “.°°! "!" I am on the Chats page I create a chat with I leave the chat room I am on the Chats page I take a screenshot named
  11. 11. Then I leave the chat room$/ tap_when_element_exists(“x tap_when_element_existsl"* sleepl ) wait_for_element_exists("* tap_when_element_existsl“s wait_for_element_exists("x tap_when_element_exists(“* wait_for_element_exists("* tap_when_element_exists(”* wait_for_element_exists("x tap_when_element_existsl“* wait_for_element_exists("* id: 'menu_more‘“) id: 'text_view_feed_settings_setting‘") {text CONTAINS[c] ‘Chat Settings‘)") {text CONTAINS [c] id: ‘alertTitle‘ {text CONTAIN$[c] ‘Leave this chat room‘}”) 'Leave‘} ) id: 'button2'“) {text CONTAINSIC] ‘Chat Settings‘}“) {text CONTAINS[c] ‘Leave this chat room‘}”) id: ‘alertTitle‘ {text CONTAINS[c] ‘Leave‘}“) id: 'button1‘“) id: ‘feed_search‘")
  12. 12. l l . -blurs ll: tin ed*2_ lIllI'IIOI'll(9)% um n: (-I ' an u: uru; :erie a " mun’ n" f ’&{”. m R i run 5' red urn ate 9 ii orin cu: e« "hail-ii ‘ a_ >sIcn“'l'rIn¢u$"| I? sri j” ' ' HI: Ic? I| uujhn 4 an: tlfrijll ; Intnnc sdnllu : :|rIIl| . usfiIfaul+ II - U’ _ I ’. .e-. .,. - é, _ rum ollmssi g 3%’ -. it . .Cupr ssingabje ts. 901'? 11 » one 11 ll .1 us ‘ e uto- -. ._. I i ran: sdctlac ‘- rozaii ‘ M _- jlrltl IRIS, “ V" , "7 to 11$ rtelu“ 1! at. A . W ‘ " mu 2 tin . t:r ‘tour: Ifilctsa Qfiflfifi in i s B , _‘ e - °"'”' "°”‘ ““ f lna. :ei: :stn: gzlasr. i.: :nsa: ,gnnnnni; mrrata ‘" K, are . ‘-' ’ . . enureslstepfieflnt uculbe ‘ D’ 2 " eal: ur: sIstep_defIntnonslcucunbergstenslcnnsét : l ___ ea: ur: sIstep_defInluonslcucimbeustepslcnats idea’; -£5-‘Fl-f§§i ! il| ll'tS; §I€D_| IeI| lIiH00!/ Clltlllbtffifillflslthll -b: 7 in
  13. 13. ’ . I’
  14. 14. l. -l . iim-V l]. llll1*'. it| l(l pr-ill) 0 . 7 4liniiliigl, lltI| lc'ligi: ‘.‘ automation 0 Automation. .. Frances ll‘ li l 4‘ #tap_when_element_ex ists(query_string, options = {}) = > Object tap_when_e lement_exists( sleepl ) tap_when_e lement_exists(
  15. 15. Android Action —Pan '1‘ #pan(query_string, direction, options = {}) = > Object Dani . ) tap_when_element_exists( sleepl )
  16. 16. ( Automation Drawerapps Android Action — long press . 4 is xiii? You joined. ‘I’ #1ong_press_when_e1e ment_exists(query_strin g, options = {}) = > Object long_p ress_when_element_exists( sleepl )
  17. 17. Android Action — enter text ‘= ° #enter_text(uiquery, text, options = {}) = > Object text_message enter text( Git Commits Bug: 4 U ' l§i§l! D§ Gloria Fraritw; ‘ . llfiiilii E? l§; '§«'. ‘ . now. to_s text messa-e)
  18. 18. Android Action - long press and slide up *3 * lLriu, . 0 4» Premier League 5 Puiii'. ~iuiv 4‘ long press and slide up -. ' 8 Git Commits ‘I’ should revise the U I definition of predefined li‘, ‘¥’«f—"§ ‘gm , .»ii. .., . r >. inri'ii, - 1'; II II ' pan action Wm if-H2231‘ ll? ‘5‘'' Bi i" n~n-. .nnnA R F;1e '1ib/ ca1abash—andro; d/touch he1pers. rb‘, line 84 84 def pan(query7string, direction, options= {}) 85 execute_gesture(Gcsture. with_parameters(Gosturc. swipe(direction, options), (query_string: query_string}. merge(options)J) 86 end options { from ( to l . execute_gesture( . with_parameters( . generate_swipe(froin, to, options), { start_target). riierge(options)))
  19. 19. The most important part of testing 9; W C 0
  20. 20. Verification as verify the element appears = i= await_for, e|ement_existsluiquery options = O) : Object = i= verify the element disappears = i= await, for, e|ement, does_not_existluiquery, options = O) 4 Object are verify element count {before v. s. afterl ( ) sleepl ) tap_when_element_exists( tap_when_element_exists(sticker_pack_view) stickerCount queryl stickerCount
  21. 21. Verification = i= pan until the element exists , j d ; ;;; : as euntil_element_ X 9 0 existsluiquery, - opts = O) 2» Object
  22. 22. Keport 3|: I Then Italic a screenshot named 'rrIl| u_stI<ker_| m|g: ' N Then I share a ‘Imago’ shared image 16 Dfig men I take a screenshot named 'sIumd_Irnaon' .1xemiziiszinep_ae¢snuioiis/ cuciumegazaps/ amreziippia. zzii27 . ii 'eaic_-. iiuiqe_av. w‘ . /zeiiziizes/ scep_ae: intuuiis/ cucuiiibe: s~_epsxa: .»ez. pps. zbiu1iui */ ‘x &dLt. An image and dzscazd Chdnqe! S/' cu: -.-ms/ a:. mzir_appiixaiicumiiuiiii wiiini x edit an illlllqa and discard ciiaiiqias‘ 169 : ap_when_ulo1non: _nxu: n(" ldx'rodo"‘) credo previous ltep no iiieepii) 171 tep_thon_e1uIent_oxlItl(" 1dt'u. ndo") Iunaa provloul atop I72 Ilooptll 173 17‘ Then I Edll an Image to save and share Then I take a screenshot named 'edit, lmige" rrieri I delete a "image" Then I edit an image and discard changes H'l1‘PC1ian'. : ixaaplilxvapuconneccadz iH1"n>cliicnc i : KaapAlivaDxacanna<: ted) [ THEI1 I take a screenshot named ’deIeted_image' ( S ieiiisriai 17 orig
  23. 23. THANK vou Now you can do testing wifh calabash! lfyou’reim‘eres1‘inqin Omlet welcome ’ro join us : ) Google search: ” M39 1%
  • LeonardLee2

    Jan. 18, 2016
  • polarpython

    Dec. 12, 2015
  • ssuser54e5f0

    Dec. 2, 2015
  • ssuser43035c

    Nov. 27, 2015
  • j796160836

    Nov. 27, 2015
  • hanzeshie

    Nov. 24, 2015
  • GaryWang1

    Nov. 23, 2015
  • marslin1220

    Nov. 23, 2015
  • TingYaoHsu

    Nov. 22, 2015
  • stevenhardyqq4

    Nov. 20, 2015
  • Bedardsalamonem17

    Nov. 20, 2015
  • manualperrypzx16

    Nov. 20, 2015
  • guywhatleyzx7456

    Nov. 20, 2015
  • 2011to

    Nov. 20, 2015
  • cspao

    Nov. 20, 2015
  • chengwc

    Nov. 20, 2015
  • ssuserc681ec

    Nov. 20, 2015
  • imjasmine

    Nov. 20, 2015
  • eosinchen

    Nov. 20, 2015
  • CarlosChang2

    Nov. 19, 2015

Presentation @ Android Taipei

Vistos

Vistos totais

1.709

No Slideshare

0

De incorporações

0

Número de incorporações

84

Ações

Baixados

35

Compartilhados

0

Comentários

0

Curtir

21

×