Skip to content

Instantly share code, notes, and snippets.

@AlexeyRaga
Created August 14, 2013 13:34
Show Gist options
  • Save AlexeyRaga/6231118 to your computer and use it in GitHub Desktop.
Save AlexeyRaga/6231118 to your computer and use it in GitHub Desktop.
F# Canopy - text fixture syntax
open canopy
open canopy.runner
open helpers
start firefox
fixture "asd" {
url "http://google.com"
"input[type=text]" << "Alexey Raga"
"input[type=text]" == "Alexey Raga"
sleep 3
}
run()
quit()
module helpers
open canopy
open canopy.runner
type TestFixture(description) =
let mutable funcs: (unit->unit) list = []
member this.Zero() = ()
member this.Delay(expression) = funcs <- expression :: funcs
member this.Run(x) =
description &&& fun _ -> funcs |> List.iter (fun expr -> expr())
let fixture description = TestFixture(description)
@panesofglass
Copy link

You could extend this with the query extensions. See http://fpish.net/view/224. Very cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment