Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

手機自動化測試和持續整合

5,310 views

Published on

1. 手動測試曠日廢時,原始碼變化太快。
2. 前天測試沒有問題,現場操作就炸了!
本主題試圖提供通用的解決方案,無論您的平台是 iOS, Android 還是 Firefox OS,都能透過自動化測試工具和 CI/CD,驗證產品可靠度,降低開發和測試成本,提升軟體品質。

手機自動化測試和持續整合

  1. 1. Carl Su Nov 01, 2015
  2. 2. • • Hacking Thursday • CI/CD
  3. 3. • PyCon APAC: Introduction to Robot Framework • COSCUP 2015 Git Workflows
  4. 4. • • • (CI/CD) •
  5. 5. • • • • •
  6. 6. • 30 TDD •
  7. 7. • iOS 6.0+: UIAutomation • Android 2.3+: Instrumentation • Android 4.2+: UiAutomator • Firefox OS: Marionette • etc…
  8. 8. iOS • UIAutomation • JavaScript
  9. 9. Android • 2.3 Instrumentation • 4.2 UiAutomator • Java
  10. 10. Firefox OS • Marionette WebDriver • Python JavaScript
  11. 11. • open source • • App
  12. 12. Appium 1. App 2. 3. 4. Java, Objective-C, JavaScript, PHP, Python, Ruby, C#, Perl Robot Framework
  13. 13. • App • Web App • App
  14. 14. Demo
  15. 15. Appium • client-server REST API • Selenium WebDriver JSON Wire Protocol • TouchAction / MultiAction API • Selenium Grid
  16. 16. • class xpath • Appium Inspector • Finding and interacting with elements
  17. 17. Appium Inspector
  18. 18. iOS
  19. 19. Appium • git clone git://github.com/ appium/appium.git • ./reset.sh --ios --dev • node .
  20. 20. Appium Ruby Console • page • text_exact 'UICatalog' • id('ButtonsExplain').name • text(resolve_id('ButtonsExplain')).name • page_class • x
  21. 21. • cell_names = tags('UIATableCell').map { |cell| cell.name } • cell_names.each do |name| • wait { text_exact(name).click } • wait { text_exact name.split(',').first } • wait { back } • end
  22. 22. Page Objects • Selenium Wiki : Page Objects
  23. 23. • git clone https://github.com/ appium/tutorial.git • rake ios[test]
  24. 24. appium.txt • [caps] • platformName = "iOS" • platformVersion = "9.1" • deviceName = "iPhone Simulator" • app = "./<your_app>.app" • name = "Ruby iOS Tutorial"
  25. 25. Continuous Integration
  26. 26. (CI) • Automated • Build • Continuous: CI • Continuous integration: • (Continuous integration, CI)
  27. 27. Git • GitHub Flow • GitLab Flow • COSCUP Git workflows
  28. 28. Jenkins • • Subversion, Git, Mercurial • GitHub, GitLab, Bitbucket
  29. 29. • Xcode Plugin • KKBOX iOS Jenkins • How To Build Android Apps with Jenkins
  30. 30. • #!/bin/bash --login • cd ~/Documents/mopcon2015/ tutorial/projects/ruby_ios • rake ios[test]
  31. 31. Demo
  32. 32. • Apple Developer ID • (certificate) (provisioning profile) • iPad / iPhone • .ipa • Xcode
  33. 33. Appium
  34. 34. (iOS) • session App • Sauce Labs • App • UI accessibility
  35. 35. (Android) • (< 4.2) session App • (< 4.2) Web App • (< 4.2) App • UI
  36. 36. • appium-doctor • • README • Troubleshooting Appium
  37. 37. • • • (CI/CD) •
  38. 38. Appium 1. App 2. 3. 4. Java, Objective-C, JavaScript, PHP, Python, Ruby, C#, Perl Robot Framework
  39. 39. (CI) • Automated • Build • Continuous: CI • Continuous integration:
  40. 40. Q & A

×