Skip to content

Instantly share code, notes, and snippets.

@ryansroberts
Created March 19, 2015 10:16
Show Gist options
  • Save ryansroberts/7f0e088e9f65f6241fe8 to your computer and use it in GitHub Desktop.
Save ryansroberts/7f0e088e9f65f6241fe8 to your computer and use it in GitHub Desktop.
type Element =
| E of IWebElement
let byId s (Element e) = e.GetElementById s
let byCss c (Element e) = e.SelectElements c
let interaction = Element -> unit
let click (Element e) = e.Click()
val bindPM<'a> : Element -> 'a
type Item {
Title of string
}
type Blog = {
Items of Item list
}
with static member from (Element e) = ..
type HomePage = {
Blog : Blog
ClickOnTheHeaderBar : interaction
}
with static member from (Element e) = {
Blog = Blog.from e
ClickOnTheMiddleWrapper = (fun () -> byId "middleWrapper" e |> click)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment