我有一个使用 Xcode 在 ObjectiveC 中构建的 iOS 应用程序和一个使用 Xamarin.UITest 用 C# 编写的 UITest,并且我正在尝试在 BitRise 中创建持续集成工作流程。
如何创建 BitRise 工作流程来构建 iOS 应用、构建 UITest,然后将输出提交到 Xamarin Test Cloud?
最佳答案
BitRise 尚无官方支持的步骤来执行此操作。
但好消息是 BitRise 允许您使用脚本创建自己的步骤!
以下是我们如何创建自己的步骤来实现这一目标!
堆栈
工作流程
脚本
构建 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"
提交至 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
我已向 BitRise 团队提出了功能请求: https://github.com/bitrise-io/bitrise.io/issues/95
关于ios - BitRise:如何将 UITests 部署到 Xamarin 测试云,用于 Xcode 中制作的 iOS 应用程序和 C# 编写的 UI 测试 (Xamarin.UITest),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41188190/