If I want to perform automated testing of a PhoneGap app (for now, only on iOS), what options do I have (if any)?
Selenium would have been my first call, but Can you use Selenium with a phonegap application? suggests that's not possible. It looks like there's an iPhone driver to run Selenium on iOS, but no indication how to make that interact with PhoneGap. The old PhoneGap wiki seems to imply that it's possible but doesn't really say how.
I had also looked at using Jasmine with the Jasmine-jQuery plugin for much the same thing but it requires duplicating the app HTML (and the overhead of keeping the two in sync etc).
Using Selenium/WebDriver with PhoneGap/Cordova Android is currently not possible. We did have this working at one point with a certain version of WebDriver, but I have been having trouble getting the current version of the WebDriver client working with custom WebViews such as the CordovaWebView, which Cordova/PhoneGap Android is based on. We are still trying to figure out how to get the new code to work nicely with custom web views, since there's no documentation for this so far.
So, sadly, the answer for this one is "not yet, but we're trying".
As of recently we've added an example on how to test PhoneGap/Cordova apps using the Open Source testing framework Appium.
Please refer to https://github.com/appium/appium/blob/master/test/functional/webview/gappium.js
Appium basically treats PhoneGap/Cordova apps as hybrid apps (embedded webview). You'll be able to automate your tests using the Selenium Webdriver JSON Wire Protocol which has language specific bindings for all popular platforms (Python, Ruby, Java, C#, Obj-c, etc.). It's even possible to switch contexts from native app to webview at any given time (e.g. if you'd like to change the orientation of the device).
My solution is QUnit. I've created a 'tests' folder inside my 'js' folder, and I've extracted all QUnit files there.
To run my tests, I launch the html page used by QUnit.
I have modified the current iPhone webdrive code to use it to test phonegap like application. I have put my code here: https://code.google.com/p/selenium-uiwebview/
The reason I am saying phonegap LIKE application cause Phonegap is just acting as a bridge. Wht I have done in my implementation is created my own simpler bridge.
But you can simply use the same code with phonegap, as I have helped one of my friend do that. Just use the latest version, cause we had some trouble with older XCode versions.
I have given detailed description on project home page. Let me know how it works.
You may get some hints from this continuous integration setup for phonegap itself
https://github.com/filmaj/medic
These are the test executed by the previous project. Just put the whole project in a phonegap project www folder
https://github.com/apache/incubator-cordova-mobile-spec
You can use Telerik's Test Studio for iOS -- we support PhoneGap applications! (Disclosure: I'm the evangelist for the Test Studio line of products.) There's a free app in the App Store which will give you record and playback style tests, and we also have an API driver available if you're looking to do framework-level testing. (The API is in beta right now. I'd be happy to give you access to it if you're interested.)