Search code examples
titaniumautomated-tests

Automated user interface testing in Titanium


How can I create automated user interface tests for a Titanium app? Does the framework include something for this? Are there any helpful third party tools?


Solution

  • Have you looked at titanium-jasmine?

    I have never personally used it but ive heard its pretty useful for this type of thing. I'm not sure about its abilities to test actually visual elements.


    EDIT:

    For testing the user interface and simulating touch events on the simulator or device, just use UIAutomation with the native workflow! Since every Titanium project compiles to an XCode project (which can and should be at least profiled for memory leaks using the native workflow before release to the app store), you can just follow the steps here to write your own tests in Javascript.

    As a first step, run your app in the simulator, then got to PROJECT_HOME/build/ and open up the xcodeproj file. Once inside XCode, hold down the "Run" button, click "Profile", which will open up "Instruments" and add the "Automation" widget like in the link I provided!

    This is not titanium specific, it can be used for any iOS app and seems like a great tool for every iOS developer, along with Allocators and Memory Leak widgets inside of instruments.

    Possibly a better alternative is using Gorilla Logic's free MonkeyTalk. It is a bit more straightforward if your not very experienced with XCode, and it has the benefit of (theoretically) being able to test iOS and Android.