How can I run a Xamarin.UITest from the commandline?

放肆的年华 提交于 2021-02-07 09:10:57

问题


I would like to run tests (made using Xamarin.UITest) on my build server, which runs TeamCity on OS X.

I have searched online on how to do this, but I am only able to find how these tests can be submitted to Xamarin Test Cloud. This is not what I want, I want to run the tests I wrote directly on devices (and/or simulators) connected to the build server.


回答1:


according to the docs (requires NUnit 2.6.3)

$ mono <path-to>/Nunit-2.6.3/bin/nunit-console.exe <path/to/uitest-assembly.dll>



回答2:


Here is what I do on OS-X:

  • Locally install the correct nunit-console.exe version
  • Build the app
  • Build the uitests
  • Run the tests

Example:

nuget install NUnit.Runners -Version 2.6.4
xbuild iOS/UITestFromCmdLine.iOS.csproj /target:Build
xbuild UITests/UITestFromCmdLine.UITests.csproj
mono ./NUnit.Runners.2.6.4/tools/nunit-console.exe UITests/bin/Debug/UITestFromCmdLine.UITests.dll


来源:https://stackoverflow.com/questions/37792674/how-can-i-run-a-xamarin-uitest-from-the-commandline

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