ANN: 0.9.144

1,002 views
Skip to first unread message

Krukow

unread,
Apr 23, 2013, 8:54:24 AM4/23/13
to calaba...@googlegroups.com
Hi all!
I've released version 0.9.144 which includes both update to client and server code as well as default procedure for launch (hooks).

Update information.


2) Update hooks: Warning this will change your hooks - if you have custom hooks you want to review and possibly skip this.
run: calabash-ios update hooks   
from your project dir containing your features (warn: will changes your hooks)

launch.rb is changed to:
hooks.rb

Changes.

The most important change is to how apps are launched. There are two ways now

- old style using 'sim_launcher' gem. This has been optimized to only start/stop the app (not simulator). Which should give a good performance boost on longer test suites. Note that it uses calabash_exit to stop the app which should make code coverage easier. To use this you must update your hooks.

- new style - using instruments. (triggered by DEVICE_TARGET=simulator or DEVICE_TARGET=device).
This was first released with experimental support in 0.9.140, but is now be fully supported although still low-level. 

After updating following the update procedure, you can do the following (please remember to clean build your -cal target and ensure server_version is 0.9.144).

krukow:~/github/talk$ DEVICE_TARGET=simulator calabash-ios console
Running irb...
irb(main):001:0> start_test_server_in_background
-------------------------------------
Auto detected APP_BUNDLE_PATH:

APP_BUNDLE_PATH=/Users/krukow/Library/Developer/Xcode/DerivedData/LPSimpleExample-ezhrrlhpryzjdofreequumptemcl/Build/Products/Debug-iphonesimulator/LPSimpleExample-cal.app

Please verify!
If this is wrong please set it as APP_BUNDLE_PATH in features/support/01_launch.rb
-------------------------------------

### Starting App: /Users/krukow/Library/Developer/Xcode/DerivedData/LPSimpleExample-ezhrrlhpryzjdofreequumptemcl/Build/Products/Debug-iphonesimulator/LPSimpleExample-cal.app ###
Waiting for App to be ready
nil
irb(main):002:0> send_uia_command :command => "target.deactivateAppForDuration(3)"
{
    "status" => "success",
     "value" => true,
     "index" => 1
}
irb(main):003:0>

Other changes:

calabash-ios-server: 

- removed all known memory leaks
- added support to flash a view (due to Kra Larivain)


Calabash iOS Ruby client:

- flash method takes a uiquery and "flashes" the view (due to Kra Larivain). Useful in console for presentation or console.

- wait_for_no_network_indicator(opts) waits for the network indicator in the title bar to disappear ([UIApplication sharedApplication] isNetworkActivityIndicatorVisible)

- default_device returns a Calabash::Cucumber::Device object with the following methods:


Due to jmoody's briar - which was included into Calabash with his permission and same license as Calabash.


Please ask questions here and post issues on github:


- Karl

Alexander Khozya

unread,
Apr 23, 2013, 10:01:35 AM4/23/13
to calaba...@googlegroups.com
Hi Karl! If I installed calabash for a "fresh" project. calabash-ios update hooks shows "----------Error---------- Unable to find file features/support/launch.rb Please change directory so that features/support/launch.rb exists." Should I rename 01_hooks.rb to hooks.rb to make it work?

Mayank Jain

unread,
Apr 23, 2013, 10:01:41 AM4/23/13
to calaba...@googlegroups.com
How does new changes port for clojure version?


--
You received this message because you are subscribed to the Google Groups "calabash-ios" group.
To unsubscribe from this group and stop receiving emails from it, send an email to calabash-ios...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Regards,
Mayank.

John Bateman

unread,
Apr 24, 2013, 2:56:19 PM4/24/13
to calaba...@googlegroups.com
Updating doesn't seem to work for me.

I have following the instructions at https://github.com/calabash/calabash-ios/wiki/B1-Updating-your-Calabash-iOS-version with one exception - instead of using the command 'gem install' I added 'calabash-cucumber' to my gemfile and entered the command 'bundle update'.

gem list calabash-cucumber returns calabash-cucumber (0.9.144, 0.9.141, 0.9.134)

I ran calabash-ios download in the directory that contains calabash-framework and got the exact same response that is documented at the github link above.

I cleaned my project and cleaned the folder and built it. The following checks returned:

Running irb...
irb(main):001:0>  require 'calabash-cucumber/version'
false
irb(main):002:0> Calabash::Cucumber::VERSION
"0.9.144"
irb(main):003:0> Calabash::Cucumber::FRAMEWORK_VERSION
"0.9.144"
irb(main):004:0> client_version
"0.9.144"
irb(main):005:0> server_version
{
             "outcome" => "SUCCESS",
            "app_name" => "Zeffer-cal",
    "simulator_device" => "iPhone",
         "iOS_version" => "5.1",
         "app_version" => "1.2.0",
              "system" => "x86_64",
              "app_id" => "com.flywheelapp.Flywheel",
             "version" => "0.9.134",
           "simulator" => "iPhone Simulator 369.2, iPhone OS 5.1 (iPhone (Retina 3.5-inch)/9B176)"
}
 

SERVER_VERSION 0.9.134 ?!?

Please offer some advice as to how to update the server version. Thanks in advance.

Karl Krukow

unread,
Apr 24, 2013, 3:06:24 PM4/24/13
to calaba...@googlegroups.com
Sounds like you need to possibly clean, reset content and settings in simulator and rebuild.

I'm pretty confident 0.9.144 bundles server 0.9.144 so it must be a local caching problem.

To rule out version problems definitively please run

bundle exec calabash-ios version
0.9.144
bundle exec calabash-ios download

- Karl

John Bateman

unread,
Apr 24, 2013, 4:59:38 PM4/24/13
to calaba...@googlegroups.com
Thanks for the quick reply.

I did run the bundle-exec command you suggested before attempting the update, with the same result of the server not being updated.

I had a senior engineer with several years' experience who is a ruby and server expert walk through the process with me, multiple times. We had the same result. Yes, we used project clean and clean-folder prior to building the project. We reset the simulator (ios Simulator-->Reset Content and Settings)

Result is still the same - server_version reporting 0.9.134.

I had the same problem when I unsuccessfully attempted to update to 9.141 last week. Might there be some artifact that is preventing this update?

Thanks for your help.

Joshua Moody

unread,
Apr 25, 2013, 7:54:46 AM4/25/13
to calaba...@googlegroups.com
i use calabash on many different projects, so i have multiple *-cal targets littered across multiple simulators.

when upgrading my calabash version, i search through ~/Library/Application Support/iPhone Simulator for *-cal targets and delete those directories.

i use the briar gem to help me do this: https://github.com/jmoody/briar

$ briar help
  briar 0.0.8
  Usage: briar rm-cal-targets
    WARN: this is a destructive operation! you have been warned.
    searches the ~/Library/Application Support/iPhone Simulator for *-cal.app
    targets and deletes the enclosing directory.  useful for clearing out old
    calabash targets when the framework needs to be updated.

the current 0.0.7 release has this briar rm-cal-targets command.

you can also do this with unix find and xargs:

find "#{sim_dir}" -type d -name '*-cal.app' | sed 's#\(.*\)/.*#\1#' | xargs -I{} rm -rf {}

WARNING: this is a destructive operation.  it will delete files from your disk.  you have been warned.

Krukow

unread,
Apr 27, 2013, 9:54:35 AM4/27/13
to calaba...@googlegroups.com
John, Did you resolve this? If you still need input - let us know.

John Bateman

unread,
Apr 27, 2013, 1:26:25 PM4/27/13
to calaba...@googlegroups.com
The iOS developer made some changes to the project and the update worked.
 I wish I could provide more details but he is traveling and not available. I will try to get more details Monday and pass them to you for the sake of a better answer for the calabash community.
--
Sincerely,

John Bateman
415.652.8322
Message has been deleted
Message has been deleted

Markus

unread,
May 16, 2013, 10:28:13 PM5/16/13
to calaba...@googlegroups.com
Hey Karl,

works like a charm if I have connected one device on my Mac. However I would like to launch and run the testcases on 3 devices (our current testing setup) in parallel. Is this possible?

Right now it starts only on the device I connected last.

I guess this has something to do with instruments. Can we tune the script so that we parse the udid or another identifier of the phone?

Cheers
Markus

Krukow

unread,
May 18, 2013, 6:45:15 AM5/18/13
to calaba...@googlegroups.com
There is a fix in the pre-release version where this is fixed:

Markus

unread,
May 18, 2013, 7:54:44 PM5/18/13
to calaba...@googlegroups.com
Hey Karl,

thx for the quick fix. I tried it out with the calabash-cucumber version: 0.9.145.pre4

Command
DEVICE_ENDPOINT=http://192.168.1.221 BUNDLE_ID=RichardBKirk.DollarBets-cal DEVICE_TARGET=d22302cbe3241099deaea85ed23ee26a3fb95fed cucumber

Result
- sometimes it works, sometimes not. I really tried to find a pattern when it was working and when not, but it is totally random. Even I was just waiting for 25 minutes. Then I tried it again (without replugging the device or something else) and I got a different error as 25 minutes before.

My procedure
1. Updated calabash version (client and server version are up-to-date with 0.9.145.pre4
2. Installed iOS app via XCode
3. Executed cucumber command (see above)

Different errors
1. Instruments Trace Error : Failed to start trace. => App didn't start
### Starting App: RichardBKirk.DollarBets-cal ###
Time out waiting for UIAutomation run-loop to Start. 
   Instruments Trace Error : Failed to start trace.
   (RuntimeError)
  /Library/Ruby/Gems/1.8/gems/run_loop-0.0.9/lib/run_loop/core.rb:120:in `run_with_options'
  /Library/Ruby/Gems/1.8/gems/run_loop-0.0.9/lib/run_loop/core.rb:272:in `run'
  /Library/Ruby/Gems/1.8/gems/calabash-cucumber-0.9.145.pre4/lib/calabash-cucumber/launcher.rb:75:in `relaunch'
  /Users/mj/Documents/workspace/Dollar-Bets/features/support/01_launch.rb:29:in `Before'
    Given I am on the Welcome Screen                 # features/step_definitions/my_first_steps.rb:1
    Then I swipe left                                # calabash-cucumber-0.9.145.pre4/features/step_definitions/calabash_steps.rb:211
    And I wait until I don't see "Please swipe left" # calabash-cucumber-0.9.145.pre4/features/step_definitions/calabash_steps.rb:149

Failing Scenarios:
cucumber features/my_first.feature:6 # Scenario: Example steps


2. Time out waiting for UIAutomation run-loop to Start. => App started, but testcases were not executed
### Starting App: RichardBKirk.DollarBets-cal ###
  Time out waiting for UIAutomation run-loop to Start. 
   2013-05-18 16:26:45.821 instruments[95544:1207] Connection to the remote device lost while launching target. Aborting...
  2013-05-18 16:26:45.823 instruments[95544:1207] Recording cancelled : At least one target failed to launch; aborting run
  Instruments Trace Error : Failed to start trace.
   (RuntimeError)
  /Library/Ruby/Gems/1.8/gems/run_loop-0.0.9/lib/run_loop/core.rb:120:in `run_with_options'
  /Library/Ruby/Gems/1.8/gems/run_loop-0.0.9/lib/run_loop/core.rb:272:in `run'
  /Library/Ruby/Gems/1.8/gems/calabash-cucumber-0.9.145.pre4/lib/calabash-cucumber/launcher.rb:75:in `relaunch'
  /Users/mj/Documents/workspace/Dollar-Bets/features/support/01_launch.rb:29:in `Before'
    Given I am on the Welcome Screen                 # features/step_definitions/my_first_steps.rb:1
    Then I swipe left                                # calabash-cucumber-0.9.145.pre4/features/step_definitions/calabash_steps.rb:211
    And I wait until I don't see "Please swipe left" # calabash-cucumber-0.9.145.pre4/features/step_definitions/calabash_steps.rb:149

3. with DEVICE_TARGET=device insted of UDID => App didn't start 
### Starting App: RichardBKirk.DollarBets-cal ###
  Time out waiting for UIAutomation run-loop to Start. 
   Instruments Usage Error : Unknown hardware device specified.
   (RuntimeError)
  /Library/Ruby/Gems/1.8/gems/run_loop-0.0.9/lib/run_loop/core.rb:120:in `run_with_options'
  /Library/Ruby/Gems/1.8/gems/run_loop-0.0.9/lib/run_loop/core.rb:272:in `run'
  /Library/Ruby/Gems/1.8/gems/calabash-cucumber-0.9.145.pre4/lib/calabash-cucumber/launcher.rb:75:in `relaunch'
  /Users/mj/Documents/workspace/Dollar-Bets/features/support/01_launch.rb:29:in `Before'
    Given I am on the Welcome Screen                 # features/step_definitions/my_first_steps.rb:1
    Then I swipe left                                # calabash-cucumber-0.9.145.pre4/features/step_definitions/calabash_steps.rb:211
    And I wait until I don't see "Please swipe left" # calabash-cucumber-0.9.145.pre4/features/step_definitions/calabash_steps.rb:149

Failing Scenarios:
cucumber features/my_first.feature:6 # Scenario: Example steps



Let me know if I can support you on this topic somehow. I would be very cool to launch the app via calabash-cucumber. I tried to check the source code of "run_loop" but couldn't find it anywhere..

Markus

Krukow

unread,
May 20, 2013, 1:48:53 PM5/20/13
to calaba...@googlegroups.com
On Sunday, May 19, 2013 1:54:44 AM UTC+2, Markus wrote:
Result
- sometimes it works, sometimes not. I really tried to find a pattern when it was working and when not, but it is totally random. Even I was just waiting for 25 minutes. Then I tried it again (without replugging the device or something else) and I got a different error as 25 minutes before.

Calabash is just calling out to instruments here (which i've seen be a bit flakey!).

a few hints: 

- make sure device is enabled for development in Xcode
- before testing make sure you've opened XCode and the device is "green" in the device view (i.e. the developer image is loaded)
- make sure XCode's instruments tool is NOT running
- make sure you don't have a screenlock on the device!


I've not been able to reproduce this instability here. I've run:

07:45 PM $ DEVICE_ENDPOINT=http://10.0.1.8:37265 DEVICE_TARGET=2c2db4e68a9243523673fc026de1bf7193593ebd OS=ios6 APP_BUNDLE_PATH=com.lesspainful.example.LPSimpleExample-cal calabash-ios console
Running irb...
irb(main):001:0> start_test_server_in_background

### Starting App: com.lesspainful.example.LPSimpleExample-cal ###
Waiting for App to be ready
nil
irb(main):002:0> start_test_server_in_background

### Starting App: com.lesspainful.example.LPSimpleExample-cal ###
Waiting for App to be ready
nil
irb(main):003:0> start_test_server_in_background

...

It works every time.

Could you try running similar commands for your app and posting the output here?

Markus

unread,
May 20, 2013, 5:23:04 PM5/20/13
to calaba...@googlegroups.com
Could you try running similar commands for your app and posting the output here?
Sure. I try it with the following commands:
1. DEVICE_ENDPOINT=http://192.168.1.221:37265 DEVICE_TARGET=d2230203ee26a3fb95fed APP_BUNDLE_PATH=RichardBKirk.DollarBets-cal OS=ios6 calabash-ios console
2. DEVICE_ENDPOINT=http://192.168.1.221:37265 DEVICE_TARGET=d2230203ee26a3fb95fed BUNLDE_ID=RichardBKirk.DollarBets-cal OS=ios6 calabash-ios console

Afterwards I entered:
irb(main):001:0> start_test_server_in_background

Still same behaviour. In 80% of the cases it isn't working. Then I wait a little and it is working again (without doing any changes). So it really unreliable.

I can see two behaviours in the error case:
1. App is launching, but app didn't get ready / testcases are not executed (with cucumber command)
2. App isn't launching at all

In both cases I get the following error message
### Starting App: RichardBKirk.DollarBets-cal ###
RuntimeError: Time out waiting for UIAutomation run-loop to Start. 
 
from /Library/Ruby/Gems/1.8/gems/run_loop-0.0.9/lib/run_loop/core.rb:120:in `run_with_options'
from /Library/Ruby/Gems/1.8/gems/run_loop-0.0.9/lib/run_loop/core.rb:272:in `run'
from /Library/Ruby/Gems/1.8/gems/calabash-cucumber-0.9.145.pre4/lib/calabash-cucumber/launcher.rb:75:in `relaunch'
from /Library/Ruby/Gems/1.8/gems/calabash-cucumber-0.9.145.pre4/lib/calabash-cucumber/core.rb:503:in `start_test_server_in_background'
from (irb):1

I ensured that:
- Device is enabled for development and the green dot is visible in the XCode organizer
- Xcode instruments isn't running

It is not really important if the device screen is locked or not. If I have a sequence where the launching works, it works with screen lock and without. It also works if the app is in the background or not in background.

It looks that the run-loop gem can't launch the app: RuntimeError: Time out waiting for UIAutomation run-loop to Start. 

Any idea?

Cheers and thanks for your help!
Markus

Markus

unread,
May 20, 2013, 6:11:12 PM5/20/13
to calaba...@googlegroups.com
----------------------    Update      -----------------------
I tried it again with an upgraded XCode and Command line tools version:
XCode: Version 4.6.2 (4H1003)

Now I can see a different behaviour:
- the app is always launching (tried it 10 times)!
- but the cucumber tests are not started / the App goes not in the state 'ready'

Error log:
## Starting App: RichardBKirk.DollarBets-cal ###
Waiting for App to be ready
Timed out...Retry..
Timed out...Retry..
Timed out...Retry..
Timed out...Retry..
Timed out...Retry..
Timed out...Retry..

Cheers
Markus

Karl Krukow

unread,
May 21, 2013, 2:36:49 AM5/21/13
to calaba...@googlegroups.com, calaba...@googlegroups.com
Are you sure you have wifi connectivity to the device? If you launch manually, can you access the /version URL in the browser?

Also, try running the same command with DEBUG=1 and dump here

Sent from my iPhone

Gardner Bickford

unread,
Jul 10, 2013, 8:19:12 PM7/10/13
to calaba...@googlegroups.com
I am running into the same issue. The app launches but the UIAutomation times out. I am able to manually run cucumber afterwards with NO_LAUNCH=1 and it succeeds because the first call to cucumber launched the app.

gardner-MacBookPro:gardner-app gardner$ DEVICE_ENDPOINT=http://10.58.19.111:37265 BUNDLE_ID=build/gardner NO_LAUNCH=1 DEVICE_TARGET=8b734996f48897703eef573f74fc3f376674b38d calabash-ios console
Running irb...
irb(main):001:0> start_test_server_in_background

### Starting App: build/gardner ###
RunLoop::TimeoutError: Time out waiting for UIAutomation run-loop to Start. 
 
from /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/run_loop-0.0.15/lib/run_loop/core.rb:128:in `rescue in run_with_options'
from /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/run_loop-0.0.15/lib/run_loop/core.rb:123:in `run_with_options'
from /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/run_loop-0.0.15/lib/run_loop/core.rb:287:in `run'
from /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/calabash-cucumber-0.9.151/lib/calabash-cucumber/launcher.rb:76:in `relaunch'
from /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/calabash-cucumber-0.9.151/lib/calabash-cucumber/core.rb:538:in `start_test_server_in_background'
from (irb):1
from /Users/gardner/.rvm/rubies/ruby-1.9.3-p286/bin/irb:16:in `<main>'
irb(main):002:0> exit
gardner-MacBookPro:gardner-app gardner$ DEBUG=1 DEVICE_ENDPOINT=http://10.58.19.111:37265 BUNDLE_ID=build/gardner NO_LAUNCH=1 DEVICE_TARGET=8b734996f48897703eef573f74fc3f376674b38d calabash-ios console
Running irb...
irb(main):001:0> start_test_server_in_background

### Starting App: build/gardner ###
2013-07-10 17:13:46 -0700 instruments -w 8b734996f48897703eef573f74fc3f376674b38d -D "/var/folders/50/n_h91t997dsfljlrv86jxp2w0000gn/T/run_loop20130710-68835-ph9sc4/trace" -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate "build/gardner" -e UIARESULTSPATH /var/folders/50/n_h91t997dsfljlrv86jxp2w0000gn/T/run_loop20130710-68835-ph9sc4 -e UIASCRIPT /var/folders/50/n_h91t997dsfljlrv86jxp2w0000gn/T/run_loop20130710-68835-ph9sc4/_run_loop.js &> /var/folders/50/n_h91t997dsfljlrv86jxp2w0000gn/T/run_loop20130710-68835-ph9sc4/run_loop.out
RunLoop::TimeoutError: Time out waiting for UIAutomation run-loop to Start. 
 
from /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/run_loop-0.0.15/lib/run_loop/core.rb:128:in `rescue in run_with_options'
from /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/run_loop-0.0.15/lib/run_loop/core.rb:123:in `run_with_options'
from /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/run_loop-0.0.15/lib/run_loop/core.rb:287:in `run'
from /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/calabash-cucumber-0.9.151/lib/calabash-cucumber/launcher.rb:76:in `relaunch'
from /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/calabash-cucumber-0.9.151/lib/calabash-cucumber/core.rb:538:in `start_test_server_in_background'
from (irb):1
from /Users/gardner/.rvm/rubies/ruby-1.9.3-p286/bin/irb:16:in `<main>'
irb(main):002:0> 

 

Gardner Bickford

unread,
Jul 10, 2013, 8:46:40 PM7/10/13
to calaba...@googlegroups.com
Update: The app on the iPad actually quits when the UIAutomation timeout occurs. 

Here is the output from the /version url:

{"outcome":"SUCCESS","app_name":"develop","simulator_device":"","iOS_version":"6.1.3","app_version":"1.0","system":"iPad3,4","app_id":"org.causeroot.gardner.develop","4inch":false,"version":"0.9.146","simulator":""}

Krukow

unread,
Jul 11, 2013, 4:26:30 PM7/11/13
to calaba...@googlegroups.com


On Thursday, July 11, 2013 2:46:40 AM UTC+2, Gardner Bickford wrote:
Update: The app on the iPad actually quits when the UIAutomation timeout occurs. 

Here is the output from the /version url:

{"outcome":"SUCCESS","app_name":"develop","simulator_device":"","iOS_version":"6.1.3","app_version":"1.0","system":"iPad3,4","app_id":"org.causeroot.gardner.develop","4inch":false,"version":"0.9.146","simulator":""}

First, I'd recommend updating to the latest version.


With that said - does that mean that the iPad app is crashing or what is going on? Does it work for you with other apps? 
Reply all
Reply to author
Forward
0 new messages