-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathSpecflow.fsx
44 lines (38 loc) · 1.56 KB
/
Specflow.fsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#r @"../../../packages/FAKE/tools/FakeLib.dll"
#load "./Utils.fsx"
open Fake
open Utils
open System
let private specFlowResultTextFile = "SpecFlowResult.txt"
let private specFlowResultHtmlFile = "SpecFlowResult.html"
let private specFlowResultXmlFile = "SpecFlowResult.xml"
let private testCategories = environVarOrDefault "TestCategories" ""
let private generateSpecFlowReport (config : Map<string, string>) =
SpecFlow
(fun defaults ->
{ defaults with
SubCommand = "nunitexecutionreport"
ProjectFile = !! @".\**\*.Features.csproj" |>Seq.head
XmlTestResultFile = specFlowResultXmlFile
TestOutputFile = specFlowResultTextFile
OutputFile = specFlowResultHtmlFile
})
let run (config : Map<string, string>) _ =
DeleteFile specFlowResultTextFile
DeleteFile specFlowResultHtmlFile
DeleteFile specFlowResultXmlFile
let testDlls = !! (sprintf @".\**\bin\%s\**\*.Features.dll" (config.get "build:configuration"))
if Seq.length testDlls > 0 then
testDlls
|> NUnit
(fun defaults ->
{ defaults with
Out = specFlowResultTextFile
OutputFile = specFlowResultXmlFile
IncludeCategory = testCategories
ErrorLevel = DontFailBuild
DisableShadowCopy = false
ShowLabels = true
TimeOut = TimeSpan.FromHours 1.
})
generateSpecFlowReport config