Automated Testingwith GHUnit and KIF             Michele TitoloSr. Mobile Engineer / Prolific Interactive            @mich...
Why test your code?
Types of Frameworks
Types of Frameworks
Types of Frameworks• Unit Testing
Types of Frameworks• Unit Testing• UI Testing
Choosing Frameworks
Unit
Unit
Unit• OCUnit/SenTestKit
Unit• OCUnit/SenTestKit• GHUnit
UI
UI
UI• UIAutomation
UI• UIAutomation• Frank
UI• UIAutomation• Frank• KIF
GHUnit
Demo
Setup
GHUnit has it’s own target
GHTestCase
Automation
Apple keeps breaking testing from CLI
JUnit test results
Gotchas
Vertical slices of functionality
Apple breaks things
UI Testing is difficult
KIF
Demo
Setup
KIF has it’s own target
KIFTestController
KIFTestScenario & KIFTestStep
Automation
ios-simhttps://github.com/phonegap/ios-sim
/usr/local/bin/ios-sim launch $APPFILE --family ipad >! ! /tmp/KIF-ipad-$$.out 2>&1
Test Output
cp "`grep "JUNIT XML RESULTS AT " /tmp/KIF-ipad-$$.out | seds/.*JUNIT XML RESULTS AT //`" test-reports/KIF-ipad-results.xml
Gotchas
[scenario addStep:[KIFTestStep stepToWaitForTimeInterval:1! description:@"wait"]];[scenario addStep:[KIFTestStep !! stepTo...
[KIFTestScenario setDefaultStepsToSetUp:[KIFTestStep! setupSteps]];
[scenario addStepsFromArray:[LoginTestStep! stepsToLoginWithEmail:TEST_EMAIL! password:TEST_PASSWORD]];
[scenario addStep:[KIFTestStep !! ! ! ! ! ! !! stepToScrollToItemWithAccessibilityLabel:@"Settings"]];
In Summary
Do tests help you writebetter code?
Do tests help you writebetter code?Yes.
Do writing tests add todev time?
Do writing tests add todev time?Yes.
Is testing worth theextra time?
Is testing worth theextra time?Absolutely.
The Endhttps://github.com/mtitolo/UICatalog-Tests             Michele Titolo             @micheletitolo
Automated Testing with GHUnit and KIF
Automated Testing with GHUnit and KIF
Automated Testing with GHUnit and KIF
Automated Testing with GHUnit and KIF
Automated Testing with GHUnit and KIF
Automated Testing with GHUnit and KIF
Automated Testing with GHUnit and KIF
Automated Testing with GHUnit and KIF
Upcoming SlideShare
Loading in …5
×

Automated Testing with GHUnit and KIF

25,228 views

Published on

This talk will explain how we can all write better code; one of the easiest ways to do this is through testing. We'll cover two popular open source frameworks, GHUnit and KIF, both of which can be automated with a CI like Jenkins.

Published in: Technology
1 Comment
5 Likes
Statistics
Notes
No Downloads
Views
Total views
25,228
On SlideShare
0
From Embeds
0
Number of Embeds
20,880
Actions
Shares
0
Downloads
20
Comments
1
Likes
5
Embeds 0
No embeds

No notes for slide

Automated Testing with GHUnit and KIF

  1. 1. Automated Testingwith GHUnit and KIF Michele TitoloSr. Mobile Engineer / Prolific Interactive @micheletitolo
  2. 2. Why test your code?
  3. 3. Types of Frameworks
  4. 4. Types of Frameworks
  5. 5. Types of Frameworks• Unit Testing
  6. 6. Types of Frameworks• Unit Testing• UI Testing
  7. 7. Choosing Frameworks
  8. 8. Unit
  9. 9. Unit
  10. 10. Unit• OCUnit/SenTestKit
  11. 11. Unit• OCUnit/SenTestKit• GHUnit
  12. 12. UI
  13. 13. UI
  14. 14. UI• UIAutomation
  15. 15. UI• UIAutomation• Frank
  16. 16. UI• UIAutomation• Frank• KIF
  17. 17. GHUnit
  18. 18. Demo
  19. 19. Setup
  20. 20. GHUnit has it’s own target
  21. 21. GHTestCase
  22. 22. Automation
  23. 23. Apple keeps breaking testing from CLI
  24. 24. JUnit test results
  25. 25. Gotchas
  26. 26. Vertical slices of functionality
  27. 27. Apple breaks things
  28. 28. UI Testing is difficult
  29. 29. KIF
  30. 30. Demo
  31. 31. Setup
  32. 32. KIF has it’s own target
  33. 33. KIFTestController
  34. 34. KIFTestScenario & KIFTestStep
  35. 35. Automation
  36. 36. ios-simhttps://github.com/phonegap/ios-sim
  37. 37. /usr/local/bin/ios-sim launch $APPFILE --family ipad >! ! /tmp/KIF-ipad-$$.out 2>&1
  38. 38. Test Output
  39. 39. cp "`grep "JUNIT XML RESULTS AT " /tmp/KIF-ipad-$$.out | seds/.*JUNIT XML RESULTS AT //`" test-reports/KIF-ipad-results.xml
  40. 40. Gotchas
  41. 41. [scenario addStep:[KIFTestStep stepToWaitForTimeInterval:1! description:@"wait"]];[scenario addStep:[KIFTestStep !! stepToWaitForViewWithAccessibilityLabel:@"Table"]];
  42. 42. [KIFTestScenario setDefaultStepsToSetUp:[KIFTestStep! setupSteps]];
  43. 43. [scenario addStepsFromArray:[LoginTestStep! stepsToLoginWithEmail:TEST_EMAIL! password:TEST_PASSWORD]];
  44. 44. [scenario addStep:[KIFTestStep !! ! ! ! ! ! !! stepToScrollToItemWithAccessibilityLabel:@"Settings"]];
  45. 45. In Summary
  46. 46. Do tests help you writebetter code?
  47. 47. Do tests help you writebetter code?Yes.
  48. 48. Do writing tests add todev time?
  49. 49. Do writing tests add todev time?Yes.
  50. 50. Is testing worth theextra time?
  51. 51. Is testing worth theextra time?Absolutely.
  52. 52. The Endhttps://github.com/mtitolo/UICatalog-Tests Michele Titolo @micheletitolo

×