vkolgi / tuneup_js

A JavaScript library to ease automated iOS UI testing with UIAutomation and Instruments.
http://www.tuneupjs.org
MIT License
717 stars 147 forks source link

Is it possible to run tuneuped UIAutomation test scripts in a build environment? #15

Closed ChenxinYan closed 12 years ago

ChenxinYan commented 12 years ago

Thanks for this great library, which makes scripts more like test cases. Now I am wondering if it can do more.

WIth UIAutomation 4.2, I am able to run tests in command line. However, I have to look through the output to check if all tests passed. This does not work for Continuous Integration build system. Is there anything available to help my case? Or I have to write an extra piece of software to parse the output then decide to fail the build or not. It helps even if tuneup_js can print out a summary that says if any test failed.

To help understanding. The following illustrates how I tick off test runs on command line and its output.

Thanks a lot!

Chexin

$ instruments -w 43f5e9e749005e145fcf0f1b5d9346e2e2b4ecf4 -t ~/Library/"Application Support"/Instruments/Templates/Template_login_tuneup_II MyApp

2012-01-12 11:31:25 -0800 Start: Test checking login then cancel 2012-01-12 11:31:25 -0800 Debug: target.frontMostApp().keyboard().typeString("somebody@someCompany.com") 2012-01-12 11:31:28 -0800 Debug: target.frontMostApp().mainWindow().secureTextFields()["password"].tap() 2012-01-12 11:31:28 -0800 Debug: target.frontMostApp().mainWindow().secureTextFields()["password"].tap() 2012-01-12 11:31:28 -0800 Debug: target.frontMostApp().keyboard().typeString("password") 2012-01-12 11:31:29 -0800 Debug: target.frontMostApp().mainWindow().buttons()["rememberMe"].tap() 2012-01-12 11:31:29 -0800 Debug: target.frontMostApp().mainWindow().buttons()["launch"].tap() 2012-01-12 11:31:31 -0800 Debug: target.frontMostApp().mainWindow().buttons()["cancel"].tap() 2012-01-12 11:31:31 -0800 Pass: Test checking login then cancel

2012-01-12 11:31:31 -0800 Start: Test checking login then cancel (II) 012-01-12 11:31:25 -0800 Debug: target.frontMostApp().keyboard().typeString("somebody@someCompany.com") 2012-01-12 11:31:28 -0800 Debug: target.frontMostApp().mainWindow().secureTextFields()["password"].tap() 2012-01-12 11:31:28 -0800 Debug: target.frontMostApp().mainWindow().secureTextFields()["password"].tap() 2012-01-12 11:31:28 -0800 Debug: target.frontMostApp().keyboard().typeString("password") 2012-01-12 11:31:36 -0800 Debug: target.frontMostApp().mainWindow().buttons()["rememberMe"].tap() 2012-01-12 11:31:36 -0800 Debug: target.frontMostApp().mainWindow().buttons()["launch"].tap() 2012-01-12 11:31:37 -0800 Debug: target.frontMostApp().mainWindow().buttons()["cancel"].tap() 2012-01-12 11:31:37 -0800 Pass: Test checking login then cancel (II)

Instruments Trace Complete (Duration : 16.793417s; Output : /Users/somebody/workspace/SVN/rtoss-trunk-1/build-client-iOS-appstore_d/ui_testing/instrumentscli14.trace)

alexvollmer commented 12 years ago

You are correct. The command-line always returns a 0 exit code which makes it difficult to integrate with other systems. You will need to write some kind of wrapper script around the instruments command-line tool to parse the output and exit with the proper code.