Search code examples
iosjenkinsios-ui-automation

How can I turn the output of my iOS UIAutomation tests into JUnit style output for Jenkins?


I am using UIAutomation scripts to test my iOS application. I've managed to get the scripts running from the command line but now I need to convert the output (pass/fails) in a format that Jenkins can understand, ideally JUnit style.

Has anyone written any scripts to do this before I try & write one?

Many thanks


Solution

  • Maybe you can have a look at : https://github.com/shaune/jasmine-ios-acceptance-tests

    Edit : I've also avoided to use jasmine. To 'listen' start, pass and fail test, I've simply replaced UIALogger.logStart, UIALogger.logFail and UIALogger.logPass :

    (function () {
        // An anonymous function wrapper helps you keep oldSomeFunction private     
        var oldSomeFunction = UIALogger.logStart;
        UIALogger.logStart = function () {
        //UIALogger.logDebug("intercepted a logStart : " + arguments);
        OKJunitLogger.reportTestSuiteStarting(arguments[0]);
        oldSomeFunction.apply(this, arguments);
        }
    })();