Skip to content

Commit

Permalink
Add packaging for UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jwood803 committed Oct 27, 2015
1 parent 42f535a commit 66208a6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
26 changes: 23 additions & 3 deletions FakeDemo/build.fsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#r "packages/FAKE/tools/FakeLib.dll"
#load "packageHelpers.fsx"
open Fake
open Fake.XamarinHelper

Expand Down Expand Up @@ -34,12 +35,29 @@ Target "Run-UnitTests" (fun _ ->
})
)

Target "Run-UITests" (fun _ ->
Target "Run-AndroidUITests" (fun _ ->
let source = PackageHelpers.androidPackage()

let dest =
filename source.FullName
|> sprintf "./RebuyApp.Android.UITests/%s"
|> fileInfo
|> PackageHelpers.moveAndroidApk source

!! @"./**/RebuyApp.Android.UITests/bin/Release/RebuyApp.Android.UITests.dll"
|> NUnit (fun defaults -> { defaults with ErrorLevel = DontFailBuild })

Shell.Exec("adb", "uninstall de.rebuy.android")
|> ignore

DeleteFile dest.FullName
)

Target "Run-iOSUITests" (fun _ ->
uiTestDll |> NUnit ( fun defaults ->
{
defaults with ToolPath = "/Library/Frameworks/Mono.framework/Commands/"
ToolName = "nunit-console4"
DisableShadowCopy = true
})
)

Expand All @@ -56,7 +74,7 @@ Target "Build-iOS" (fun _ ->
{
defaults with ProjectPath = "iOS/FakeDemo.iOS.csproj"
OutputPath = "iOS/iPhoneSimulator/Debug"
Configuration = "Debug|iPhoneSimulator"
Configuration = "Ad-Hoc|iPhone"
Target = "Build"
})
)
Expand All @@ -75,5 +93,7 @@ Target "Build-Droid" (fun _ ->
==> "Build-Pcl"
==> "Build-iOS"
==> "Build-Droid"
==> "Build-UITests"
==> "Run-AndroidUITests"

RunTargetOrDefault "Run-UnitTests"
17 changes: 17 additions & 0 deletions FakeDemo/packageHelpers.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#r "packages/FAKE/tools/FakeLib.dll"
open System.IO
open Fake
open Fake.XamarinHelper

let androidPackage() =
AndroidPackage (fun defaults ->
{
defaults with
ProjectPath = "Droid/FakeDemo.Droid.csproj"
})

let moveAndroidApk (source : FileInfo) (dest : FileInfo) =
DeleteFile dest.FullName
Rename dest.FullName source.FullName

dest

0 comments on commit 66208a6

Please sign in to comment.