适用于iOS冒烟测试的AppCenter生成后脚本问题

时间:2019-04-30 12:35:27

标签: xctest visual-studio-app-center smoke-testing

我想在AppCenter中包含一个后构建脚本,该脚本在AppCenter中将XCTests作为烟雾测试启动。该构建脚本会被AppCenter识别并执行。

不幸的是,没有Microsoft的示例显示XCTests如何在AppCenter中作为冒烟测试执行。这是我的帖子构建脚本:

我已经使用以下BuildScript进行了尝试:

#!/usr/bin/env bash

# Post Build Script
set -e # Exit immediately if a command exits with a non-zero status (failure)

echo "***********"
echo "Post Build Script"
echo "***********"

# variables
appCenterLoginApiToken=xxx
locale="de_DE"
appName="MyCustomer/MyCustomerAppiOS"
deviceSetNameDev="MyCustomer/mycustomerdevios"
deviceSetNameMaster="MyCustomer/mycustomermasterios"
testSeriesName="integration-tests"
appDebugPath=$APPCENTER_SOURCE_DIRECTORY
appReleasePath=$APPCENTER_SOURCE_DIRECTORY
buildDir=$APPCENTER_OUTPUT_DIRECTORY

# Run UITests
if [ "$APPCENTER_BRANCH" == "dev" ];
then
# app center command xcTest test

echo "########## $appName xcTest start ##########"
appcenter test run xcuitest --app $appName --devices $deviceSetNameDev --async --test-series $testSeriesName --locale $locale --build-dir $buildDir --token $appCenterLoginApiToken
echo "########## $appName xcTest finished ##########"
elif [ "$APPCENTER_BRANCH" == "master" ];
then
echo "########## $appName xcTest start ##########"
appcenter test run xcuitest --app $appName --devices $deviceSetNameMaster --async --test-series $testSeriesName --locale $locale --build-dir $buildDir --token $appCenterLoginApiToken
echo "########## $appName xcTest finished ##########"
else
echo "Current branch is not 'dev' nor 'master'"
fi

当前它与buildDir有一些问题,我得到以下错误: 失败,但出现异常“无法在/Users/vsts/agent/2.150.2/work/1/a/build中找到应用程序“

我如何确切知道带有测试的构建应用程序的位置?

如果有人可以帮助我或为我提供一个XCTests构建脚本的样子,我将非常感激。

谢谢您!

Stefan

0 个答案:

没有答案