如何从命令行将UI测试连同相关应用程序推送到App Center Test?
我使用CI(持续集成)服务器来构建我的应用程序,我尝试使用App Center测试门户网站提供的以下命令,但它不起作用并输出错误,下面:
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 26 14" xmlns="http://www.w3.org/2000/svg">
<rect width="2" height="2"/>
<rect x="4" width="2" height="2"/>
<rect x="8" width="2" height="2"/>
<rect x="12" width="2" height="2"/>
<rect x="16" width="2" height="2"/>
<rect x="20" width="2" height="2"/>
<rect x="24" width="2" height="2"/>
<rect x="24" y="4" width="2" height="2"/>
<rect x="20" y="4" width="2" height="2"/>
<rect x="16" y="4" width="2" height="2"/>
<rect x="12" y="4" width="2" height="2"/>
<rect x="8" y="4" width="2" height="2"/>
<rect x="4" y="4" width="2" height="2"/>
<rect y="4" width="2" height="2"/>
<rect y="8" width="2" height="2"/>
<rect x="4" y="8" width="2" height="2"/>
<rect x="8" y="8" width="2" height="2"/>
<rect x="12" y="8" width="2" height="2"/>
<rect x="16" y="8" width="2" height="2"/>
<rect x="20" y="8" width="2" height="2"/>
<rect x="24" y="8" width="2" height="2"/>
<rect x="24" y="12" width="2" height="2"/>
<rect x="20" y="12" width="2" height="2"/>
<rect x="16" y="12" width="2" height="2"/>
<rect x="12" y="12" width="2" height="2"/>
<rect x="8" y="12" width="2" height="2"/>
<rect x="4" y="12" width="2" height="2"/>
<rect y="12" width="2" height="2"/>
</svg>
命令&appcenter test运行uitest&#39;需要登录用户。使用&#39; appcenter登录&#39;命令登录
我正在尝试部署Xamarin.Android应用和Xamarin.UITest。
答案 0 :(得分:3)
App Center CLI要求用户登录,我们可以通过提供登录令牌从我们的构建服务器登录。
使用App Center CLI,输入以下命令,将[Name Of Token]
替换为您要为此令牌命名的任何内容
appcenter login
appcenter tokens create -d "[Name Of Token]"
它会提供这样的回复:
ID:[Unique Guid]
API令牌:[唯一API令牌]
描述:[令牌名称]
创建于:[时间戳]
复制API令牌结果。我们将在CI脚本中使用它。
在持续集成管道中,使用此bash脚本将APK文件+ UI测试推送到App Center测试
bash脚本执行以下操作:
[My UI Test Assembly Name]
替换为UI测试程序集的名称#!/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 from Step 1]
appcenter test run uitest --app "bminnick/uitestsampleapp" --devices b139e40f --app-path $APKFile --test-series "master" --locale "en_US" --build-dir $UITestBuildDir --async