Jenkins cant start first test case

Been getting appium setup on a CI server using jenkins this week, after sorting out a few user permissions problems Jenkins can build my test suite, launch appium, and my app in simulator but it cant seem to start my tests. This is the shell script I’ve written for appium to run as a build step-

#!/bin/bash -l

rvm use ruby-2.2.0

appium --platform-version "8.1" --session-override --platform-name "iOS"  --command-timeout "7200"  --native-instruments-lib --pre-launch --app "/Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/onenikecommerce-inhouse-edgbmhpyclblvicstodwnrzxaxdc/Build/Products/Debug-iphonesimulator/..." &&

cd /Users/Shared/Jenkins/Home/jobs/iOS_Automation/workspace/cucumber_ios
bundle install
cd /Users/Shared/Jenkins/Home/jobs/iOS_Automation/workspace/cucumber_ios/features/support
arc
cd /Users/Shared/Jenkins/Home/jobs/iOS_Automation/workspace/cucumber_ios
cucumber

If I kick the tests off from another terminal shell after Jenkins has launched my app in simulator the test suite runs without issue, appium can start and stop the simulator as required (I have 3 tests ATM). Any help would be much appriciated!

1 Like

Ok seem to have found a workaround for this but it seems less than ideal - I first launch appium in the background

appium --platform-version "8.1" --session-override --platform-name "iOS"  --command-timeout "7200"  --native-instruments-lib --pre-launch --app "/Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/onenikecommerce-inhouse-edgbmhpyclblvicstodwnrzxaxdc/Build/Products/Debug-iphonesimulator/..." &

then sleep 20s giving the server plenty of time to start before I call cucumber from the correct directory…

If it makes you feel better, I do the exact same thing. I’ll let you know if I find a more intelligent wait