We are trying to get UI Tests working with Xcode Cloud. They run fine locally on the developer's machine, but they are failing when run on Xcode Cloud.
We use Wiremock to mock the api calls, and this seems to be failing on Xcode Cloud as I see logs stating the server isn't found.
I tried 2 approaches to run wiremock during the ui tests:
Adding a Pre-action to the "Test" action of the UI Test Scheme to launch wiremock (this is what we use in local builds):
#!/bin/sh
exec > /tmp/preaction-log.txt 2>&1
if [[ -n $CI_XCODE_CLOUD ]];
then
java -jar ./wiremock/wiremock-current.jar --port 8080 --https-port 8081 --verbose &
else
java -jar $SRCROOT/ci_scripts/wiremock/wiremock-current.jar --port 8080 --https-port 8081 --verbose &
fi
Launching wiremock in a custom xcode cloud script: ci_pre_xcodebuild. I know it is getting called because other items in that script executes.
#!/bin/sh
if [ $CI_XCODEBUILD_ACTION = 'test-without-building' ]
then
java -jar ./wiremock/wiremock-current.jar --port 8080 --https-port 8081 --verbose &
fi
Note that wiremock is in the ci_scripts directory which I understand should be accessible during testing.
Any ideas how to run wiremock so it is accessible during ui testing? I hope I'm just missing something obvious here.