Run iOS monotouch GUI tests automatically from the command line

I am trying to figure out how to automatically launch the GUI of my monotouch application from the command line? I mean running GUI tests on the iOS simulator from CL. The only GUI testing method I found is the Teleric tool, but it is not automated

Some tips? Thanks

+6
source share
2 answers

If you are looking for something to help you with TDD, you might be interested in calabas: https://github.com/calabash/calabash-ios

+1
source

You can use the UIAutomation framework to achieve automated graphics tests. This is not strictly from the command line, but you run Javascript scripts using the Tools tool. It works great with Monotouch (the time I used it).

The apple documentation for UIAutomation is pretty detailed; and hopefully should cover everything you need.

To give an example script ( "Credit to Jackson" from "Hist" for this script, shamelessly taken from there).

 var target = UIATarget.localTarget(); var window = UIATarget.localTarget().frontMostApp().mainWindow (); var table = window.tableViews () [0]; var results_cell = table.cells () [0] var run_cell = table.cells () [1]; var passed = false; var results = ''; run_cell.tap (); while (true) { target.delay (5); try { results = results_cell.name (); } catch (e) { UILogger.logDebug ('exception'); continue; } if (results.indexOf ('failure') != -1) { passed = false; break; } if (results.indexOf ('Success!') != -1) { passed = true; break; } } UIALogger.logDebug ('Results of test run: ' + results); UIALogger.logDebug ('Passed: ' + passed); 
0
source

All Articles