问题
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