Cucumber fails when using json formatter

123 views
Skip to first unread message

h...@renatorodrigues.me

unread,
Mar 12, 2014, 11:53:40 AM3/12/14
to calaba...@googlegroups.com
I'm setting up a job on Jenkins to run calabash-ios and return the results in json but it fails while if I use the pretty formatter, it works without problems. Cucumber returns json successfuly if using my main account (renato.miguel) but fails on Jenkins (jenkins account).

#!/bin/bash

source /Users/renato.miguel/.jenkins_profile

security unlock-keychain -p <password> /Users/Shared/Jenkins/Library/Keychains/login.keychain

rvm use 2.1.1@calabash

PROJECT="LPSimpleExample.xcodeproj"
CONFIG="Automated"
SCHEME="LPSimpleExample-cal"
SDK="iphonesimulator"
BUILDDIR="$WORKSPACE/BuildOutputDir"
OUTPUTDIR="$BUILDDIR/$CONFIG-$SDK"
APPNAME="LPSimpleExample"

xcodebuild -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" clean build

DEVICE_TARGET=simulator DEVICE=iphone
cucumber -f json -o results.json -f pretty  # this fails

Feature: Running a test
  As an iOS developer
  I want to have a sample feature file
  So I can begin testing quickly

  Scenario: Example steps                            # features/my_first.feature:6
  Calabash::Cucumber::Launcher::StartError: Time out waiting for UIAutomation run-loop to Start. 
   Logfile /var/folders/0c/cxcfkb7n2fvc6vmwzn9sz26m000088/T/run_loop20140312-14889-r1qaod/run_loop.out 
  
   2014-03-12 15:49:34.008 ScriptAgent[15101:2f07] CLTilesManagerClient: initialize, sSharedTilesManagerClient
  2014-03-12 15:49:34.008 ScriptAgent[15101:2f07] CLTilesManagerClient: init
  2014-03-12 15:49:34.008 ScriptAgent[15101:2f07] CLTilesManagerClient: reconnecting, 0x10b609c40
  2014-03-12 15:49:34.020 ScriptAgent[15101:2f07] AXError: Could not auto-register for pid status change
  2014-03-12 15:49:34.023 ScriptAgent[15101:2f07] Failed to enable accessiblity, kAXErrorServerNotFound
  
   (Calabash::Cucumber::Launcher::StartError)
  /Users/renato.miguel/.rvm/gems/ruby-2.1.1@calabash/gems/calabash-cucumber-0.9.167/lib/calabash-cucumber/launcher.rb:386:in `new_run_loop'
  /Users/renato.miguel/.rvm/gems/ruby-2.1.1@calabash/gems/calabash-cucumber-0.9.167/lib/calabash-cucumber/launcher.rb:313:in `relaunch'
  /Users/Shared/Jenkins/Home/jobs/UI-Automation/workspace/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.167/features/step_definitions/calabash_steps.rb:234
    And I wait until I don't see "Please swipe left" # calabash-cucumber-0.9.167/features/step_definitions/calabash_steps.rb:165
    And take picture                                 # calabash-cucumber-0.9.167/features/step_definitions/calabash_steps.rb:229

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

1 scenario (1 failed)
4 steps (4 skipped)

While writing this post, I've tried two more times to run this job. The first attempt. it generated successfuly the json. Second one failed as most of the times.

Joshua Moody

unread,
Mar 12, 2014, 7:02:34 PM3/12/14
to calaba...@googlegroups.com
thank you thank you thank you for the _formatting_ 

+1

the problem has nothing to do with the cucumber formatters:

# this is known bug with Xcode 5.1 + calabash 0.9.167 + simulator
# we are working on a fix
AXError: Could not auto-register for pid status change

The workaround is to rollback to Xcode 5.0.2 or turn on Accessibility in the iOS Simulator.

h...@renatorodrigues.me

unread,
Mar 13, 2014, 5:11:46 AM3/13/14
to calaba...@googlegroups.com
Thank you, Joshua. Glad to know the reason of the problem. With physical devices, the Accessibility stuff applies too?

Joshua Moody

unread,
Mar 13, 2014, 7:01:15 AM3/13/14
to calaba...@googlegroups.com
With physical devices, the Accessibility stuff applies too?
 
No.  

Xcode 5.1 + calabash + physical devices = no problems.


Reply all
Reply to author
Forward
0 new messages