-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathappcenter_uitest_run.ps1
48 lines (41 loc) · 1.44 KB
/
appcenter_uitest_run.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[CmdletBinding()]
param (
[Switch]
$SkipBuild,
[string]
$BuildConfiguration = "Release"
)
. .\common.ps1
if(!$SkipBuild) {
BuildApkAndUiTest
}
[string] $testOutputDir = ".\artifacts"
[string] $testResultDir = "$testOutputDir\xmls"
[string] $orgName = "JacobEgnerDemos"
appcenter test run uitest `
--app "$orgName/$appName" `
--app-path "$env:UITEST_APK_PATH" `
--devices "$orgName/demo_device_set" `
--test-series "master" `
--locale "en_US" `
--build-dir "..\$uiTestProjName\bin\$BuildConfiguration" `
--uitest-tools-dir "..\$uiTestProjName\bin\$BuildConfiguration" `
--test-output-dir $testOutputDir
# I'd love to add a `--merge-nunit-xml "AppCenterUiTestResult.xml"` to the
# command, but that gives an error and I have filed an issue:
# https://github.com/microsoft/appcenter-cli/issues/1208
Expand-Archive "$testOutputDir\nunit_xml_zip.zip" -DestinationPath "$testResultDir"
Write-Output "test result files..."
Get-ChildItem "$testResultDir"
Write-Output "what pipeline task could print to publish the test results..."
Get-ChildItem .\artifacts\xmls\ | ForEach-Object { Write-Output `
( "##vso[results.publish " `
+ "runTitle=Android App Center UI Test Run $($_.BaseName);" `
+ "resultFiles=$($_.FullName);" `
+ "type=NUnit;" `
+ "mergeResults=false;" `
+ "publishRunAttachments=true;" `
+ "failTaskOnFailedTests=false;" `
+ "testRunSystem=VSTS - PTR;" `
+ "]" `
)}