运行 Azure 管道中的 UWP appium 测试
Run UWP appium tests in azure pipeline
只是想知道是否可以 运行 基于 Appium UI 测试 Azure 管道中的 UWP 应用程序?
第一个挑战是,如何部署 UWP 以在管道内进行测试。
我想通了。
- 我们需要在构建之后安装应用程序,这可以使用 运行构建构建工件中包含的 powershell 脚本来完成。但是重要的是证书的安装,需要强制安装。
- task: PowerShell@2
displayName: 'Install app'
inputs:
filePath: '$(build.artifactstagingdirectory)\AppxPackages\MyApp_1.0.0.0_Test\Add-AppDevPackage.ps1'
arguments: '-Force'
- 对于 运行 测试用例,需要安装 WinAppDriver。参见 WinAppDriver in CI with Azure Pipelines
2.1 您还需要在测试前后启动和停止 win 应用程序驱动程序
- task: Windows Application Driver@0
displayName: Starting WinAppDriver
inputs:
OperationType: 'Start'
AgentResolution: '1080p'
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*Test*.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
uiTests: true
- task: Windows Application Driver@0
displayName: Stopping WinAppDriver
inputs:
OperationType: 'Stop'
只是想知道是否可以 运行 基于 Appium UI 测试 Azure 管道中的 UWP 应用程序?
第一个挑战是,如何部署 UWP 以在管道内进行测试。
我想通了。
- 我们需要在构建之后安装应用程序,这可以使用 运行构建构建工件中包含的 powershell 脚本来完成。但是重要的是证书的安装,需要强制安装。
- task: PowerShell@2
displayName: 'Install app'
inputs:
filePath: '$(build.artifactstagingdirectory)\AppxPackages\MyApp_1.0.0.0_Test\Add-AppDevPackage.ps1'
arguments: '-Force'
- 对于 运行 测试用例,需要安装 WinAppDriver。参见 WinAppDriver in CI with Azure Pipelines
2.1 您还需要在测试前后启动和停止 win 应用程序驱动程序
- task: Windows Application Driver@0
displayName: Starting WinAppDriver
inputs:
OperationType: 'Start'
AgentResolution: '1080p'
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*Test*.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
uiTests: true
- task: Windows Application Driver@0
displayName: Stopping WinAppDriver
inputs:
OperationType: 'Stop'