Run Xamarin UI and Unit Tests in Windows. Pull from your git repo, build projects and run tests.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
scripts
README.md
Run.bat

README.md

Xamarin Test Box for Windows

Twitter: @seba47

Run Xamarin UI and Unit(xunit) Tests in Windows with only 2 clicks. Pull from your repo, build projects and run tests.

Platform Support

Platform Available
Xamarin.Android alt text
Xamarin.iOS alt text

Requirements


Pre-Configuration

If you have never compile your solution on this machine, do it!

NuGet packages should be in the file system so be sure they were restored after building. Enabling and disabling package restore.

Git Bash

If you have not used the bash, please login with your credentials because they will be needed later to get the last version of the tests.

NUnit Console

Give read/write permission to TestResult.xml (located into NUnit console folder)

xUnit doesn´t need configuration


Setup

Complete your solution path in pull-git-repo.sh

...
cd /e/Projects/MyProject
...

Complete project name and paths in StartTesting.bat

...
REM *** VARs declarations - REQUIRED! ***
SET projectName=MyProject

SET androidProjectFilePath=E:\Projects\MyProject\MyProject\MyProject.Droid\MyProject.Droid.csproj

SET xunitPath=E:\Projects\MyProject\packages\xunit.runner.console.2.2.0\tools
SET unitTestProjectFilePath=E:\Projects\MyProject\Test\MyProject.UnitTest\MyProject.UnitTest.csproj
SET unitTestReleaseLibraryPath=E:\Projects\MyProject\Test\MyProject.UnitTest\bin\Release\MyProject.UnitTest.dll

SET nunitPath=C:\Program Files (x86)\NUnit.org\nunit-console
SET uITestProjectFilePath=E:\Projects\MyProject\Test\MyProject.UITest\MyProject.UITest.csproj
SET uiTestReleaseLibraryPath=E:\Projects\MyProject\Test\MyProject.UITest\bin\Release\MyProject.UITest.dll
...

Running Test Process

Open Run.bat and the process will be the next:

  • Git Pull on the current branch of the project
  • Build Android project (If your git pulls take much longer time,you can increase the waiting time for compiling Android: into Run.bat - line 10)
  • Build UnitTest project
  • Build UITest project
  • Open xUnit Console and run Unit tests
  • Run UI tests in the connected device

Clarifications

This tool works with only one solution. You should create folders with those scritps as solutions you have.

Based on the requirement number 3, UI tests will run in one physical device (previously configured in the UI Test project).


Version history

1.0 (September 07, 2017)

  • First version which shoulb be run manually in windows. It pulls the code, builds the projects and then runs unit tests and ui tests in your connected Android device.

Working on

  • Run Unit tests created with NUnit
  • Restore NuGet Packages
  • Support for multiple Visual Studio solutions
  • Run UI tests in iOS device
  • Mac support
  • Run UI tests in multiple connected devices.
  • Continuous Integration with GitHub Repos using WebHooks and Node.js

Contributions

Feel free to add improvements and all stuffs that help us to get a better testing process. Contact me if you have suggestions.