anchor.diff:    write (destination "generated_paths") generated_paths_result
     write (destination "generated_validation") generated_validation_result
     write (destination "generated_unittests") generated_unittests_result
  -  write (destination "generated_uitests") generated_uittests_result
  +  write (destination "generated_uitests") generated_uitests_result
  
positive.code:   | Null       -> None
    | NotNull    -> None
    | Required   -> Some (sprintf """required "%s" %s""" field.Name property)
    | Min(_)     -> None
    | Max(_)     -> None
    | Range(_,_) -> None
  
negative.code:   ] |> List.choose id
    """ page.AsFormType page.AsFormVal page.AsFormType validations
  
  let contextTemplate (page : Page) = sprintf """context "%s" """ page.Name |> pad 1
  
  let beforeTemplate (page : Page) =
    sprintf """before (fun _ -> url "http://localhost:8083%s"; click ".btn") """ page.AsHref
    |> pad 1
  
  let attributeUITestTemplate name field =
    match name with
    | None -> None
    | Some(name) ->
      let top = (sprintf """%s&&& fun _ ->""" name) |> pad 1
      let body = (attributeToTestBody field).Value |> pad 2
      Some (sprintf """%s
  %s
      """ top body)
  
  let fieldUITestTemplate name field =
    match name with
    | None -> None
    | Some(name) ->
      let top = (sprintf """%s&&& fun _ ->""" name) |> pad 1
      let body = (fieldToTestBody field).Value |> pad 2
      Some (sprintf """%s
  %s
      """ top body)
  
  let toTest (field : Field) =
    let name = attributeToTestName field
    let name2 = fieldToTestName field
    [attributeUITestTemplate name field; fieldUITestTemplate name2 field]
  
  let uitestTemplate (page : Page) =
    if page.Fields = [] then ""
    else
      let tests = page.Fields |> List.map toTest |> List.concat |> List.choose id |> flatten
      sprintf """%s
  
  %s
  
  %s
      """ (contextTemplate page) (beforeTemplate page) tests
  
  let generate (site : Site) =
    let html_results = site.Pages |> List.map pageLinkTemplate |> flatten
    let generated_html_result = generated_html_template html_results
  