Add Steps to Deploy UITests to Xamarin Test Cloud When The App is Written in Xcode and the UI Tests are Written in C# (Xamarin.UITest)

From @brminnick on Mon Nov 14 2016 12:19:32 GMT-0500 (EST)

# Feature Request: Add officially supported steps that enable users to build their UI Test and deploy their UI tests to Xamarin Test Cloud when their app is written in Xcode and the UI Tests are written in C#/Xamarin.UITest

Below is the Workflow that I put together with great help from @godrei and @bradumbaugh!

Stack

Use the Xamarin Stable Stack

Workflow

Scripts

Build UITest

#!/bin/bash
# fail if any commands fails
set -e
# debug log
set -x

# write your script here
SOLUTION_FILE=`find . -name YOUR_UITEST_SOLUTION_FILENAME.sln`

"/Applications/Xamarin Studio.app/Contents/MacOS/mdtool" "build" $SOLUTION_FILE "-c:Debug" "-p:YOUR_UITEST_PROJECT_NAME"

envman add --key ASSEMBLY_DIR --value "/Users/vagrant/git/FOLDER_PATH_TO_YOUR_UITEST_PROJECT/bin/Debug"

Submit to XTC

#!/bin/bash
# fail if any commands fails
set -e
# debug log
set -x

# write your script here
MONO="/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono" 
TEST_CLOUD=`find . -name test-cloud.exe`
UITestDll=`find . -name Xamarin.UITest.dll`

cp -f $UITestDll $ASSEMBLY_DIR

$MONO $TEST_CLOUD submit $BITRISE_IPA_PATH $TestCloudAPIKey --series "master" --locale "en_US" --user $TestCloudUserName --assembly-dir $ASSEMBLY_DIR --devices $TestCloudDeviceKey --async-json

Edit: Added step inside of "Submit to XTC’ to copy Xamarin.UITest.dll into the Assembly Directory

Copied from original issue: https://github.com/bitrise-io/bitrise.io/issues/95

From @viktorbenei on Mon Nov 14 2016 12:21:43 GMT-0500 (EST)

Thanks for the scripts @brminnick ! Labels added :wink:

From @brminnick on Mon Nov 14 2016 12:27:08 GMT-0500 (EST)

Thanks @viktorbenei! @godrei was a huge help, and I couldn’t have done it without him!

From @brminnick on Fri Dec 16 2016 10:23:28 GMT-0500 (EST)

Update: I added the following code to the “Submit to XTC” step, above, to ensure that the Xamarin.UITest.dll is in the Assembly Directory.

UITestDll=`find . -name Xamarin.UITest.dll`

cp -f $UITestDll $ASSEMBLY_DIR

From @viktorbenei on Sat Dec 17 2016 06:39:30 GMT-0500 (EST)

Nice catch, thanks @brminnick ! :wink: