Skip to content

Commit

Permalink
refactor uitesting
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Jan 28, 2020
1 parent 30ba3a5 commit e2871eb
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<NoWarn>NU1201</NoWarn>
</PropertyGroup>

<PropertyGroup Condition=" '$(BUILD_ARTIFACTSTAGINGDIRECTORY)' != '' ">
<OutputDir>$(ArtifactStagingRoot)</OutputDir>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1">
Expand Down
14 changes: 11 additions & 3 deletions Source/build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ variables:
value: Release
- name: BuildPlatform
value: Any CPU
- name: AppCenterDroidSlug
value: Prism/Sandbox.Android
- name: AppCenterDroidAppName
value: Sandbox.Android
- name: AppCenterDroidDevices
value: 8804278a
- group: SignClient
Expand Down Expand Up @@ -61,6 +61,14 @@ stages:

- template: jobs/xamarin-uitest.yml

- template: jobs/sandbox-uitest.yml
parameters:
artifactName: Sandbox-Android
sandboxJobName: sandboxAndroid
appFile: '$(Pipeline.Workspace)/Sandbox-Android/com.prismlibrary.helloworld.apk'
appName: $(AppCenterDroidAppName)
devices: $(AppCenterDroidDevices)

- stage: buildPackage
displayName: Build Prism Library
jobs:
Expand All @@ -78,7 +86,7 @@ stages:
steps:
- template: steps/appcenter-deploy.yml
parameters:
appName: 'Sandbox.Android'
appName: $(AppCenterDroidAppName)
appFile: '$(Pipeline.Workspace)/Sandbox-Android/com.prismlibrary.helloworld.apk'
distributionGroup: '88fd9e93-9e2e-4a44-bda4-e7d6bf8f7a10'

Expand Down
3 changes: 1 addition & 2 deletions Source/build/jobs/sandbox-android.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
buildConfiguration: 'Debug'
buildConfiguration: 'Release'
versionName: ''

jobs:
Expand Down Expand Up @@ -48,4 +48,3 @@ jobs:
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: Sandbox-Android
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
1 change: 0 additions & 1 deletion Source/build/jobs/sandbox-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@ jobs:
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: Sandbox-iOS
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
39 changes: 39 additions & 0 deletions Source/build/jobs/sandbox-uitest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
parameters:
artifactName: ''
sandboxJobName: ''
appFile: ''
appName: ''
devices: ''

jobs:
- job: appCenterTests-${{ parameters.artifactName }}
displayName: App Center Tests ${{ parameters.artifactName }}
dependsOn: |
${{ parameters.sandboxJobName }}
xamarinUITest
pool:
vmImage: $(VMImage)
demands:
- MSBuild
workspace:
clean: all
steps:
- task: DownloadPipelineArtifact@2
displayName: Download UI Test Project
inputs:
artifactName: XamarinUITests
targetPath: '$(Pipeline.Workspace)'
- task: DownloadPipelineArtifact@2
displayName: Download ${{ parameters.artifactName }}
inputs:
artifactName: ${{ parameters.artifactName }}
targetPath: '$(Pipeline.Workspace)'
- task: AppCenterTest@1
displayName: 'Run UI Tests ${{ parameters.artifactName }} with App Center'
inputs:
appFile: ${{ parameters.appFile }}
frameworkOption: uitest
uiTestBuildDirectory: $(Pipeline.Workspace)/XamarinUITests/
serverEndpoint: 'Prism-AppCenter'
appSlug: 'Prism/${{ parameters.appName }}'
devices: ${{ parameters.devices }}
23 changes: 9 additions & 14 deletions Source/build/jobs/xamarin-uitest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
jobs:
- job: xamarinUITest
displayName: HelloWorld.UITests
dependsOn: sandboxAndroid
pool:
vmImage: $(VMImage)
demands:
Expand All @@ -13,18 +12,14 @@ jobs:
parameters:
solution: Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.UITests/HelloWorld.UITests.csproj
solutionName: HelloWorld.UITests
- task: DownloadPipelineArtifact@2
inputs:
artifactName: 'Sandbox-Android'
targetPath: '$(Pipeline.Workspace)'
- task: AppCenterTest@1
displayName: 'Test Android with Visual Studio App Center'

- powershell: Get-ChildItem . -Recurse | ForEach-Object -Process { $_.FullName }
displayName: List Artifacts

- task: PublishPipelineArtifact@0
displayName: 'Publish Sandbox Artifacts'
inputs:
appFile: '**/*.apk'
frameworkOption: uitest
uiTestBuildDirectory: 'Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.UITests/bin/$(BuildConfiguration)/net461/'
serverEndpoint: 'Prism-AppCenter'
appSlug: '$(AppCenterDroidSlug)'
devices: '$(AppCenterDroidDevices)'
enabled: true
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: XamarinUITests


0 comments on commit e2871eb

Please sign in to comment.