From c62b8c6e01c60978dbb1fddbc396ccb4d4fa3660 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 9 Oct 2015 18:13:03 -0400 Subject: [PATCH] Add UI Test build targets --- FakeDemo/UITests/Tests.cs | 1 - FakeDemo/build.fsx | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/FakeDemo/UITests/Tests.cs b/FakeDemo/UITests/Tests.cs index 4358dc3..58542fb 100644 --- a/FakeDemo/UITests/Tests.cs +++ b/FakeDemo/UITests/Tests.cs @@ -29,7 +29,6 @@ public void BeforeEachTest() public void WelcomeTextIsDisplayed() { AppResult[] results = app.WaitForElement(c => c.Marked("Welcome to Xamarin Forms!")); - app.Screenshot("Welcome screen."); Assert.IsTrue(results.Any()); } diff --git a/FakeDemo/build.fsx b/FakeDemo/build.fsx index 7376b47..17f9871 100644 --- a/FakeDemo/build.fsx +++ b/FakeDemo/build.fsx @@ -5,6 +5,8 @@ open Fake.XamarinHelper let buildDir = "FakeDemo/bin/Debug" let testProj = !! "FakeDemo.UnitTests/FakeDemo.UnitTests.csproj" let testDll = !! "FakeDemo.UnitTests/bin/Debug/FakeDemo.UnitTests.dll" +let uiTestProj = !! "UITests/FakeDemo.UITests.csproj" +let uiTestDll = !! "UITests/bin/Debug/FakeDemo.UITests.dll" Target "Clean" (fun _ -> CleanDir buildDir @@ -16,6 +18,12 @@ Target "Build-UnitTests" (fun _ -> |> Log "---Unit Test build output----" ) +Target "Build-UITests" (fun _ -> + uiTestProj + |> MSBuild "UITests\bin\Debug" "Build" [ ("Configuration", "Debug"); ("Platform", "Any CPU") ] + |> Log "---UI Test build output----" +) + Target "Run-UnitTests" (fun _ -> testDll |> NUnit ( fun defaults -> { @@ -27,7 +35,12 @@ Target "Run-UnitTests" (fun _ -> ) Target "Run-UITests" (fun _ -> - trace "UI Tests" + uiTestDll |> NUnit ( fun defaults -> + { + defaults with ToolPath = "/Library/Frameworks/Mono.framework/Commands/" + ToolName = "nunit-console4" + DisableShadowCopy = true + }) ) Target "Build-Pcl" (fun _ ->