use*_*680 2 jenkins xamarin xamarin.uitest visual-studio-app-center visual-studio-app-center-test
要执行Xamarin Test Cloud测试,您必须执行appcenter命令,例如
appcenter test run uitest --app "appName" --devices 228faeda --app-path *appPath* --test-series "master" --locale "en_US" --build-dir *debugFolderPath*
Run Code Online (Sandbox Code Playgroud)
这非常有效.
我想通过Jenkins触发这个命令.
我使用上面显示的命令添加了"执行Windows批处理命令".
我执行构建.
但是我在控制台输出中收到以下错误
"C:\ Program Files(x86)\ Jenkins\workspace\Xamarin Test Cloud Android> appcenter'appcenter'不被识别为内部或外部命令,可操作程序或批处理文件."
这是为什么?
谢谢
确保首先安装appcenter-cli.
npm install -g appcenter-cli
Run Code Online (Sandbox Code Playgroud)
下面是我用于CI的bash脚本.要实现它,您首先需要从App Center获取身份验证令牌.
该应用中心CLI需要将登录的用户,我们可以通过提供一个登录令牌从我们构建服务器登录.
使用App Center CLI,输入以下命令,替换[Name Of Token]为您要为此令牌命名的任何内容
appcenter login
appcenter tokens create -d "[Name Of Token]"
Run Code Online (Sandbox Code Playgroud)
它将提供这样的响应:
ID:[独特的指导]
API令牌:[唯一API令牌]
描述:[令牌名称]
创建于:[时间戳]
bash脚本执行以下操作:
[My UI Test Assembly Name]为UI测试程序集的名称[login token]为您的登录令牌的值[Your App Center App Name]为您的应用名称的值[Your Device Id]为您的设备ID的值#!/usr/bin/env bash
UITestDLL=`find . -name "[My UI Test Assembly Name].dll" | grep bin`
UITestBuildDir=`dirname $UITestDLL`
APKFile=`find . -name *.apk | head -1`
npm install -g appcenter-cli
appcenter login --token [login token]
appcenter test run uitest --app "[Your App Center App Name]" --devices [Your Device Id] --app-path $APKFile --test-series "master" --locale "en_US" --build-dir $UITestBuildDir --async
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2220 次 |
| 最近记录: |