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

iOS Automated UI testing + Continuous Integration

iOS Automated UI testing + Continuous Integration

Ievgen Salo

November 22, 2014
Tweet

More Decks by Ievgen Salo

Other Decks in Programming

Transcript

  1. Con-nuous  Integra-on “Con%nuous  Integra%on  is  a  so0ware   development  prac%ce

     where  members  of   a  team  integrate  their  work  frequently.   Each  integra%on  is  verified  by  an   automated  build  (including  test)  to  detect   integra%on  errors  as  quickly  as  possible.” Mar-n  Fowler
  2. Automa-on Neal  Ford “Computers  are  designed  to  do  simple  

      repe%%ve  tasks.  When  you  have     humans  doing  repe%%ve  tasks,  all  the     computers  get  together  late  at  night     and  laugh  at  you…”
  3. Travis  CI + -­‐ • paid   • doesn’t  support

     beta  Xcode • maintenance  free   • easy  setup
  4. Jenkins + -­‐ • maintenance   • need  resources •

    free   • can  configure  every  step   • extendable  
  5. UI  Automa-on var target = UIATarget.localTarget(); var application = target.frontMostApp();

    var window = application.mainWindow(); var view = window.elements()[0]; Simple  Script var buttons = window.buttons(); // Check for a button on screen if (buttons.length != 1) { UIALogger.logFail("FAIL: The button is missing."); } else { UIALogger.logPass("PASS: There is a button on the screen."); }
  6. Zucchini Use  natural  language  for     interacFon  scenarios Test

     against  your  own  screenshots www.zucchiniframework.org
  7. Cloud  Monkey Powerful  and  robust     record  and  playback

     funcFons   for  mobile  applicaFons Powerfull  IDE Fully  cross  plaUorm cloudmonkeymobile.com/monkeytalk
  8. Cloud  Monkey cloudmonkeymobile.com/monkeytalk <?xml version="1.0" encoding="UTF-8"?> <project name="MyTests" xmlns:monkeytalk=“antlib:com.gorillalogic.monkeytalk.ant"> <target

    name="TestScript"> <monkeytalk:run agent="iOS" script="${basedir}/login.mt" /> </target> <target name=“InlineTest"> <monkeytalk:run agent="iOS"> Input username EnterText John Input password EnterText "my pass" Button LOGIN Tap </monkeytalk:run> </target> </project> Ant  Build  file  for  ConFnuous  IntegraFon
  9. #!/bin/bash --login killall -9 "iPhone Simulator" &> /dev/null killall -9

    ruby &> /dev/null killall -9 node &> /dev/null killall -9 instruments &> /dev/null cd ~/tests/modules/source/ruby_ios bundle update flake 1 ios[test] Appium  Shell  Script  for  ConFnuous  IntegraFon Appium appium.io