其他测试框架 The current state of iOS automated functional testing

恒温 · 2014年02月07日 · 963 次阅读

zz from http://watirmelon.com/2013/11/04/the-current-state-of-ios-automated-functional-testing/

I’ve been working on an iOS project and have been looking for a suitable automated functional test library to drive the iOS GUI. I must say that automated iOS testing feels like automated web testing did about 10 years ago: lots of different tools taking different approaches, and all approaches quite flaky!

Through research I came across quite a few different tools that support iOS automated functional testing but need to work out which one is best.

Whilst I often advocate writing functional tests in the same language as your codebase, in the case of iOS and Objective C, I think using a more lightweight language like Ruby has its own advantages (I don’t really like Objective C).

The one thing I really dislike with a lot of these iOS functional test tools is how they are married to Cucumber and encourage users to write tests like “I tap button x” and “I scroll through list y”. These types of tests are much harder to read as they express implementation over intention and should be avoided.

I will also be writing tests for an Android app so being able to use the same tool-set is a great advantage to me.

I also personally prefer an approach where I don’t need to modify the core behavior of my app to run tests against it (designing for testability is completely different and vital). Some approaches embed some sort of server to receive automation commands, which the user must then remove later because it uses undocumented Apple APIs which will lead to app store rejection. Being able to run tests against the app that you submit to the app store means you can be more confident you have tested it right.

Finally, the iOS app I am working on using embedded web views to display dynamic content from the server, which can be interacted with, and therefore it is vital that these can be interacted with. This feature is actually very rare in an iOS automation framework.

Here’s the list of iOS functional automation tools I am aware of and how they stack up:

  • Tool: Frank
    Language: Ruby
    Test Framework: Also supports OSX apps
    Supports other mobile plaforms: Also supports OSX apps
    Approach: Requires you to embed a symbiote server in your app and uses undocumented APIs
    Deploy same app to store: NO
    Supports testing web-views?: NO (only via JavaScript calls)

  • Tool: KIF
    Language: Objective C
    Test Framework: OCUnit/SenTest
    Supports other mobile plaforms: NO
    Approach: Modifies your app to use undocumented APIs
    Deploy same app to store: NO
    Supports testing web-views?: NO

  • Tool: Subliminal
    Language: Objective C
    Test Framework: OCUnit/SenTest
    Supports other mobile plaforms: NO
    Approach: Embeds into your project but uses UIAutomation instead of undocumented APIs
    Deploy same app to store: NO
    Supports testing web-views?: NO

  • Tool: Zucchini
    Language: Custom DSL (CoffeeScript/Ruby)
    Test Framework: Custom
    Supports other mobile plaforms:
    Approach: Generates UIAutomation JavaScript that is executed against your app
    Deploy same app to store: YES
    Supports testing web-views?: NO

  • Tool: Calabash
    Language: Ruby
    Test Framework: Cucumber
    Supports other mobile plaforms: Also supports Android Apps
    Approach: Requires you to embed a server in your app to control it
    Deploy same app to store: NO
    Supports testing web-views?: YES

  • Tool: Appium
    Language: Ruby, C#, Java, JavaScript, Objective C, PHP, Python, Perl, Clojure
    Test Framework: Agnostic
    Supports other mobile plaforms: Also supports Mac OSX apps, Android Firefox OS
    Approach: Uses Instruments to control app using the standard WebDriver WIRE protocol
    Deploy same app to store: YES
    Supports testing web-views?: YES

  • Tool: ios-driver
    Language: Ruby, C#, Java, JavaScript, Objective C, PHP, Python, Perl, Clojure
    Test Framework: Agnostic
    Supports other mobile plaforms: NO
    Approach: Uses Instruments to control app using the standard WebDriver WIRE protocol
    Deploy same app to store: YES
    Supports testing web-views?: YES

I’ll let you guess which tool I selected until I write my next blog post about how to get started in that tool.

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册