Run UWP appium tests in azure pipeline

混江龙づ霸主 提交于 2020-01-24 01:14:06

问题


Just wondering if it is possible to run Appium based UI tests for a UWP app in azure pipeline?

The first challenge is, how to deploy the UWP to test within the pipeline.


回答1:


I managed to figure it out.

  1. We need to install the app after the build, which can be done using running the powershell script included in the build artifacts. But the important things is the installation of the certificate, which needed to be forced.
- task: PowerShell@2
  displayName: 'Install app'
  inputs:
    filePath: '$(build.artifactstagingdirectory)\\AppxPackages\\MyApp_1.0.0.0_Test\\Add-AppDevPackage.ps1'
    arguments: '-Force'
  1. To run the test cases it is required that WinAppDriver is installed. See WinAppDriver in CI with Azure Pipelines

2.1 You would also need to start and stop the win app driver before and after the tests

- 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'


来源:https://stackoverflow.com/questions/57743995/run-uwp-appium-tests-in-azure-pipeline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!