-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCanopyRepl.fsx
More file actions
71 lines (63 loc) · 1.81 KB
/
CanopyRepl.fsx
File metadata and controls
71 lines (63 loc) · 1.81 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#I "./FSharpModules/UnionArgParser/lib/net40"
#I "./FSharpModules/Microsoft.SqlServer.Types/lib/net20"
#I "./FSharpModules/FSharp.Data/lib/net40"
#I "./FSharpModules/FSharp.Data.SqlClient/lib/net40"
#I "./FSharpModules/Http.fs/lib/net40"
#I "./FSharpModules/Selenium.WebDriver/lib/net40"
#I "./FSharpModules/Selenium.Support/lib/net40"
#I "./FSharpModules/SizSelCsZzz/lib"
#I "./Fsharpmodules/Newtonsoft.Json/lib/net40"
#I "./FSharpModules/canopy/lib"
#I "./FsharpModules/Http.fs/lib/net40"
#r "UnionArgParser.dll"
#r "Microsoft.SqlServer.Types.dll"
#r "FSharp.Data.SqlClient.dll"
#r "HttpClient.dll"
#r "WebDriver.dll"
#r "WebDriver.Support.dll"
#r "HttpClient.dll"
#r "canopy.dll"
#r "System.Core.dll"
#r "System.Xml.Linq.dll"
#r "FSharp.Data.dll"
open HttpClient
open canopy
open runner
open System
open System.Collections.ObjectModel
open FSharp.Data
open Nessos.UnionArgParser
open types
open reporters
open configuration
open OpenQA.Selenium.Firefox
open OpenQA.Selenium
open OpenQA.Selenium.Support.UI
open OpenQA.Selenium.Interactions
let exists selector =
let e = someElement selector
match e with
| Some(e) -> true
| _ -> false
let openBrowser _ =
configuration.chromeDir <- "./"
let options = Chrome.ChromeOptions()
options.AddArgument("--enable-logging")
options.AddArgument("--v=0")
start (ChromeWithOptions options)
browser.Manage().Cookies.DeleteAllCookies()
let ids _ =
(js """
return $('[id]').map(function(a) {
return $($('[id]')[a]).attr('id');
})
""") :?> ReadOnlyCollection<System.Object> |> List.ofSeq
let names _ =
(js """
return $('[name]').map(function(a) {
return $($('[name]')[a]).attr('name');
})
""") :?> ReadOnlyCollection<System.Object> |> List.ofSeq
openBrowser()
url "http://localhost:4000"
reload()