UI Tests with mock server

I'm using Xcode Cloud for release builds and unit tests, and it works fine. Recently, I added some XCUITests, but to run it the way I need I started to use this mock server. Basically, the idea is you define before each test what responses you want to get for specific requests. It works like a charm locally. But if I want to run it in Xcode Cloud, it looks like the server has failed to launch. The mock server is a separately launched binary file. I think this is because this permission I get when launch it locally.

So, my question is how to allow this kind of permission in Xcode Cloud to make my UITests works correctly? You can find a detailed instruction how server is launched on a github page I provided.

Answered by ivavilov in 845893022

OK, finally I was able to fix it. The problem was that my mock server CLI tool is installing in ci_post_clone.sh. But tests are run afterwards on different machines, so it doesn't have this tool. Also, I didn't see any errors in logs, so I had to move it around a little bit. Long story short: I moved install step from ci_post_clone.sh to ci_pre_xcodebuild.sh to run installation step on every machine that run my UI tests.

Please file a bug report, attach your artifacts and a sysdiagnose file to your report, then post the Feedback number here.

Accepted Answer

OK, finally I was able to fix it. The problem was that my mock server CLI tool is installing in ci_post_clone.sh. But tests are run afterwards on different machines, so it doesn't have this tool. Also, I didn't see any errors in logs, so I had to move it around a little bit. Long story short: I moved install step from ci_post_clone.sh to ci_pre_xcodebuild.sh to run installation step on every machine that run my UI tests.

UI Tests with mock server
 
 
Q