Post

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

By Rafaela Azevedo
Hello guys !
I hope you are fine. I am searching here for a problem that I had for the second time when I tried to run cucumber and calabash in a PC.
First, I got the installation of cucumber framework on the app, but when I run the command: cucumber. The splash screen appears a lot of times, but the app doesn’t start. It seems that the cucumber are trying to open the app and something is blocking.
After you have all configured, this problem won’t happen again. I am trying to reproduce the problem in my PC and since this already is configured the problem didn’t happen again. For this reason I think that it is some permission or update type of problem.

Look on the launch.rb file inside the folder features/support if the line APP_BUNDLE_PATH is commented with # in front of. (Because this just have to be used as the last case if the app doesn’t start). There should generally be no need to set ANY environment variables for default project setups. APP_BUNDLE_PATH should only be set if Calabash is not able to detect it correctly. SDK_VERSION should only be set if you don’t want to run in the latest iOS simulator version. OS should never need to need to be set.
Check if the cucumber is installed in the app:
calabash-ios check PATH_TO_IPA_OR_APP

Disable your firewall: https://groups.google.com/forum/#!msg/calabash-ios/AXrXhGB2_mc/wIzR16Sm2IEJ

Try running with sudo.
Verify if your permission is of admin and what is the user that you is trying to run cucumber (must be the same)
Verify if you have permission to access the page of the project and the .app with the user that you are using to run cucumber
Have you built the -cal target from XCode?
Are you using Xcode5? Have you run sudo xcode-select -switch PATH_TO_XCODE/Content/Developer.When using the final version of Xcode5 you should havexcode-select -print-path
/Applications/Xcode.app/Contents/Developer➜ ~ instruments
instruments, version 5.0 (51166)Xcode5 must be installed in the default /Applications/Xcode.app location
Please stop the simulator. Do not start it from Xcode, instead let Calabash launch the simulator.
Make sure you use the iPhone Retina or the iPad simulator. There is a well-known bug with instruments and its ability to launch the iPhone (non-retina simulator).
Try the following – it is the easiest way to test if it is working:In your project folder (typically the folder just above your ‘features’ folder), run:

DEBUG=1 calabash-ios console
start_test_server_in_background(:timeout => 30)

run_loop.out
What is the contents of this file? run
cat /var/folders/…/run_loop.out

The password prompt seems to be bogus, as hit cancel still allows calabash to do what it needs to do, and everything works.To resolve the issue, I edited /etc/authorization:

user

rule
rule

is-developer

This changes system.privilege.taskport, which was using the implicit user rule to ensure the current user was a member of _developer to an explicit rule to do the same. The end security constraints should be identical, and now a password prompt is never shown for calabash. SSH runs work just fine.
security authorizationdb write system.privilege.taskport is-developer

Try use this command to debug the session and discover what is happening:
DEBUG=1 calabash-ios console

Start the installation again:

Comment out the APP_BUNDLE_PATH definition on YourProject/features/support/01_launch.rb like #APP_BUNDLE_PATH = “~/…./../myApp-cal.app” so The calabash gem can locate the app automatically.
Open a console go to the project folder from it. Then enter gem install calabash-cucumber this will install the calabash gem its ok to run again even if you installed it previously there’s no harm.
Now open the project file in xcode editor (You can see the calabash.framework added to your project’s framework group successfully.) select the yourApp-cal target and the simulator you want clean, build and run the your App-cal target on your simulator.
Then stop it and come back to that console enter calabash-ios console console will start a ruby console that you can work with the app. now (while simulator is on your screen but your app is backbround on that simulator) type start_test_server_in_background your app must come to foreground. If that works the calabash can find and run your app on simulator.
Remember only if you create an app build on a separate folder using a xcodebuild command or script or something, thats the time to set the APP_BUNDLE_PATH variable.

Look what is the result of these commands:

# xcode installation location
$ xcode-select –print-path
# xcode version
$ xcodebuild -version
# calabash version
$ calabash-ios version
# calabash.framework version
# start your app manually in the simulator or from Xcode
# and then launch a console
$ calabash-ios console
server_version

Look if it is enable, running this command:
DevToolsSecurity -status

Try these steps:

Update gem packages: sudo gem update
Cleanup old gem packages: sudo gem cleanup
Execute “Clean build folder…” in Xcode
Close Xcode and simulator
Delete all folders from /Developer/Xcode/DerivedData
Reboot your computer
Rebuild your project and run the tests

Try reset Simulators:
killall ‘iPhone Simulator’

rm -rf ~/Library/Application Support/iPhone Simulator/

You can turn on additional calabash debugging running:
DEBUG=1 CALABASH_FULL_CONSOLE_OUTPUT=1 calabash-ios console

Connect to calabash-ios console and use query when executing command:
DEVICE=ipad DEVICE_ENDPOINT=http://xx.xx.xxx.xx:37265 BUNDLE_ID=build/LPSimpleExample-cal DEVICE_TARGET=device calabash-ios console

Follow these steps:

Reboot the device
Make sure you can see the device from XCode “devices” (Cmd-2) and that it is “green”
Make sure the app is installed on the device
Make sure you can run “profile” with automation from xcode
Make sure the device doesn’t have a “autolock passlock code”
Reboot your mac.

Use OS key for OS version, name key for device, key-value options list should be comma separated.
For example:

xcodebuild -project ABC.xcodeproj -scheme ABC-cal -destination OS=6.1,name=iPad

Clear the instruments:

Run this command:
killall -9 instruments

And restart the device sometimes works.

After trying all these things, restart your pc and try again:
$ SDK_VERSION=6.0 DEVICE_TARGET=simulator DEVICE=iphone cucumber
(This is the last hope… lol)

Thank you again !
Fonts:
https://groups.google.com/forum/#!msg/calabash-ios/AXrXhGB2_mc/wIzR16Sm2IEJ
https://github.com/calabash/calabash-ios/issues/203
https://github.com/calabash/calabash-ios#important-notice
http://www.gerardcondon.com/blog/2012/10/22/setting-up-calabash-on-ios/
https://groups.google.com/forum/#!topic/calabash-ios/b1f1sVtU0ys
https://github.com/calabash/calabash-ios/wiki/A0-UIAutomation—instruments-problems
https://github.com/calabash/calabash-ios/wiki/01-Getting-started-guide
https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/UsingtheAutomationInstrument/UsingtheAutomationInstrument.html
http://stackoverflow.com/questions/24022823/ios-simulator-doesnt-launch-with-calabash
https://groups.google.com/forum/#!msg/calabash-ios/B3OUOYf7lFY/u8uBYGCOyosJ
https://groups.google.com/forum/#!topic/calabash-ios/ntpNi91DeCE
https://groups.google.com/forum/#!msg/calabash-ios/jfx9CvVoliw/EARXTGYdaFkJ
http://www.marshut.com/uvuzr/calabash-tests-do-not-start-on-iphone-devise-though-application-has-been-started.html
http://www.marshut.com/vutwq/for-people-with-launch-and-ios7-questions.html#imqxmw
http://www.marshut.com/mxzin/instrument-errors-when-trying-to-execute-test-cases-in-device-calabash-9-144.html

Source: http://azevedorafaela.wordpress.com/2014/06/09/i-run-cucumber-on-my-app-and-after-trying-open-it-closed-with-error/

Category: Programming, QA, Test and Automation Stuffs, my app didn’t start with cucumber, permissions problems when run cucumber on my app, run cucumber and the app isn’t start, run cucumber on my app and didn’t start, run cucumber on my app and the app is closed, run cucumber on my app and the splash screen appears but the after trying the app close, something is wrong with instruments when I run cucumber on my app

Você também pode querer ler

Comments are off for this post.