Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Talking myself into the value of acceptance testing

Talking myself into the value of acceptance testing

I've spent some time working on acceptance testing recently, but I'm not always sure if there is actually value in this practice. In this talk we'll explore the tradeoffs of acceptance testing, and see how to get started writing acceptance tests for iOS.

Gio Lodi

June 21, 2015
Tweet

More Decks by Gio Lodi

Other Decks in Programming

Transcript

  1. Having the intern make sure that when logging in with

    Facebook the profile picture is the set correctly is a test for an acceptance criteria
  2. Apple UI Testing / * * * W h e

    n I t a p t h e " s a y h e l l o " b u t t o n , I s e e a g r e e t i n g s a l e r t . * / t e s t S a y H e l l o ( ) { l e t a p p = X C U I A p p l i c a t i o n ( ) a p p . b u t t o n s [ " s a y h e l l o " ] . t a p ( ) a p p . a l e r t s [ " H e l l o " ] . c o l l e c t i o n V i e w s . b u t t o n s [ " D i s m i s s " ] . t a p ( ) }
  3. Apple UI Testing / * * * W h e

    n I t a p t h e " s h o w e l e m e n t e s " b u t t o n , I s e e t h e l i s t w i t h * t h e e l e m e n t s o f t h e p e r i o d i c t a b l e . * / t e s t S h o w E l e m e n t s ( ) { l e t a p p = X C U I A p p l i c a t i o n ( ) a p p . b u t t o n s [ " s h o w e l e m e n t s " ] . t a p ( ) X C T A s s e r t E q u a l ( a p p . t a b l e s . c o u n t , 1 ) l e t t a b l e = a p p . t a b l e s . e l e m e n t A t I n d e x ( 0 ) l e t p e r i o d i c T a b l e E l e m e n t s C o u n t : U I n t = 1 1 8 X C T A s s e r t E q u a l ( t a b l e . c e l l s . c o u n t , p e r i o d i c T a b l e E l e m e n t s C o u n t ) }
  4. KIF

  5. KIF d e s c r i b e (

    @ " M a i n s c r e e n " , ^ { c o n t e x t ( @ " w h e n I t a p t h e ' s a y h e l l o ' b u t t o n " , ^ { b e f o r e ( ^ { [ t e s t e r t a p V i e w W i t h A c c e s s i b i l i t y L a b e l : k S a y H e l l o ] ; } ) ; i t ( @ " I s e e a g r e e t i n g s a l e r t " , ^ { [ t e s t e r w a i t F o r V i e w W i t h A c c e s s i b i l i t y L a b e l : k H e l l o A l e r t T i t l e ] ; [ t e s t e r w a i t F o r V i e w W i t h A c c e s s i b i l i t y L a b e l : k H e l l o A l e r t M e s s a g e ] ; [ t e s t e r w a i t F o r V i e w W i t h A c c e s s i b i l i t y L a b e l : k H e l l o A l e r t B u t t o n ] ; } ) ; } ) ; } ) ;
  6. "A bug is only a test that hasn't been written

    yet" - I don't know who said this
  7. Where to go from here Xcode 7 UI testing -

    WWDC KIF on GitHub mokacoding.com > Acceptance Testing Generative Testing