Skip to content

Commit

Permalink
Fix #130, removed github tests and demotests
Browse files Browse the repository at this point in the history
  • Loading branch information
lefthandedgoat committed Feb 7, 2014
1 parent 83b030c commit eb543ed
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 336 deletions.
4 changes: 2 additions & 2 deletions AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("canopy")>]
[<assembly: AssemblyTitleAttribute("canopy")>]
[<assembly: AssemblyDescriptionAttribute("A simple framework in f# on top of selenium for writing UI automation and tests. Change Log at https://github.com/lefthandedgoat/canopy/wiki/Change-Log")>]
[<assembly: AssemblyVersionAttribute("0.9.3")>]
[<assembly: AssemblyVersionAttribute("0.9.4")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "0.9.3"
let [<Literal>] Version = "0.9.4"
2 changes: 1 addition & 1 deletion Build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open Fake.AssemblyInfoFile

// Assembly / NuGet package properties
let projectName = "canopy"
let version = "0.9.3"
let version = "0.9.4"
let projectDescription = "A simple framework in f# on top of selenium for writing UI automation and tests. Change Log at https://github.com/lefthandedgoat/canopy/wiki/Change-Log"
let authors = ["Chris Holt"]

Expand Down
26 changes: 0 additions & 26 deletions canopy.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "canopy", "canopy\canopy.fsproj", "{63135CF6-70A9-4382-851D-4B679EE0CBF8}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "githubtests", "githubtests\githubtests.fsproj", "{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "basictests", "basictests\basictests.fsproj", "{D4610DE2-BFD2-491D-AD72-BBBB206E11C7}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "demotests", "demotests\demotests.fsproj", "{B586358E-A544-4DB9-A8A3-C7D330B0540B}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "documentationtests", "documentationtests\documentationtests.fsproj", "{A39AE288-5534-43ED-ADFD-2E401E2C25BA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{51B54B14-A7C3-450B-A722-159E9CD3010F}"
Expand Down Expand Up @@ -40,17 +36,6 @@ Global
{63135CF6-70A9-4382-851D-4B679EE0CBF8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{63135CF6-70A9-4382-851D-4B679EE0CBF8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{63135CF6-70A9-4382-851D-4B679EE0CBF8}.Release|x86.ActiveCfg = Release|Any CPU
{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}.Debug|Any CPU.ActiveCfg = Debug|x86
{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}.Debug|Any CPU.Build.0 = Debug|x86
{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}.Debug|Mixed Platforms.Build.0 = Debug|x86
{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}.Debug|x86.ActiveCfg = Debug|x86
{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}.Debug|x86.Build.0 = Debug|x86
{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}.Release|Any CPU.ActiveCfg = Release|x86
{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}.Release|Mixed Platforms.ActiveCfg = Release|x86
{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}.Release|Mixed Platforms.Build.0 = Release|x86
{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}.Release|x86.ActiveCfg = Release|x86
{39971FE8-10E6-4F9B-8345-1C64BDDD99E2}.Release|x86.Build.0 = Release|x86
{D4610DE2-BFD2-491D-AD72-BBBB206E11C7}.Debug|Any CPU.ActiveCfg = Debug|x86
{D4610DE2-BFD2-491D-AD72-BBBB206E11C7}.Debug|Any CPU.Build.0 = Debug|x86
{D4610DE2-BFD2-491D-AD72-BBBB206E11C7}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
Expand All @@ -62,17 +47,6 @@ Global
{D4610DE2-BFD2-491D-AD72-BBBB206E11C7}.Release|Mixed Platforms.Build.0 = Release|x86
{D4610DE2-BFD2-491D-AD72-BBBB206E11C7}.Release|x86.ActiveCfg = Release|x86
{D4610DE2-BFD2-491D-AD72-BBBB206E11C7}.Release|x86.Build.0 = Release|x86
{B586358E-A544-4DB9-A8A3-C7D330B0540B}.Debug|Any CPU.ActiveCfg = Debug|x86
{B586358E-A544-4DB9-A8A3-C7D330B0540B}.Debug|Any CPU.Build.0 = Debug|x86
{B586358E-A544-4DB9-A8A3-C7D330B0540B}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{B586358E-A544-4DB9-A8A3-C7D330B0540B}.Debug|Mixed Platforms.Build.0 = Debug|x86
{B586358E-A544-4DB9-A8A3-C7D330B0540B}.Debug|x86.ActiveCfg = Debug|x86
{B586358E-A544-4DB9-A8A3-C7D330B0540B}.Debug|x86.Build.0 = Debug|x86
{B586358E-A544-4DB9-A8A3-C7D330B0540B}.Release|Any CPU.ActiveCfg = Release|x86
{B586358E-A544-4DB9-A8A3-C7D330B0540B}.Release|Mixed Platforms.ActiveCfg = Release|x86
{B586358E-A544-4DB9-A8A3-C7D330B0540B}.Release|Mixed Platforms.Build.0 = Release|x86
{B586358E-A544-4DB9-A8A3-C7D330B0540B}.Release|x86.ActiveCfg = Release|x86
{B586358E-A544-4DB9-A8A3-C7D330B0540B}.Release|x86.Build.0 = Release|x86
{A39AE288-5534-43ED-ADFD-2E401E2C25BA}.Debug|Any CPU.ActiveCfg = Debug|x86
{A39AE288-5534-43ED-ADFD-2E401E2C25BA}.Debug|Any CPU.Build.0 = Debug|x86
{A39AE288-5534-43ED-ADFD-2E401E2C25BA}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
Expand Down
14 changes: 7 additions & 7 deletions canopy/canopy.fs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ let elements cssSelector = findMany cssSelector elementTimeout browser true

let unreliableElements cssSelector = findMany cssSelector elementTimeout browser false

let unreliableElement cssSelector = cssSelector |> unreliableElements |> elementFromList cssSelector

let element cssSelector = cssSelector |> elements |> elementFromList cssSelector

let elementWithin cssSelector (elem:IWebElement) = find cssSelector elementTimeout elem true
Expand Down Expand Up @@ -254,8 +256,7 @@ let private writeToSelect cssSelector text =
| head::tail -> head.Click()

let ( << ) cssSelector text =
wait elementTimeout (fun _ ->
wait elementTimeout (fun _ ->
let writeToElement (e : IWebElement) =
if e.TagName = "select" then
writeToSelect cssSelector text
Expand Down Expand Up @@ -409,16 +410,15 @@ let contains (value1 : string) (value2 : string) =

let count cssSelector count =
try
wait compareTimeout (fun _ -> ( let elems = elements cssSelector
elems.Length = count))
wait compareTimeout (fun _ -> (unreliableElements cssSelector).Length = count)
with
| :? CanopyElementNotFoundException as ex -> raise (CanopyCountException(sprintf "%s\r\ncount failed. expected: %i got: %i" ex.Message count 0))
| :? WebDriverTimeoutException -> raise (CanopyCountException(sprintf "count failed. expected: %i got: %i" count (elements cssSelector).Length))
| :? WebDriverTimeoutException -> raise (CanopyCountException(sprintf "count failed. expected: %i got: %i" count (unreliableElements cssSelector).Length))

let private regexMatch pattern input = System.Text.RegularExpressions.Regex.Match(input, pattern).Success

let elementsWithText cssSelector regex =
elements cssSelector
unreliableElements cssSelector
|> List.filter (fun elem -> regexMatch regex (textOf elem))

let elementWithText cssSelector regex = (elementsWithText cssSelector regex).Head
Expand Down Expand Up @@ -467,7 +467,7 @@ let notDisplayed item =
wait compareTimeout (fun _ ->
match box item with
| :? IWebElement as element -> not(shown element)
| :? string as cssSelector -> (unreliableElements cssSelector |> List.isEmpty) || not(element cssSelector |> shown)
| :? string as cssSelector -> (unreliableElements cssSelector |> List.isEmpty) || not(unreliableElement cssSelector |> shown)
| _ -> raise (CanopyNotStringOrElementException(sprintf "Can't click %O because it is not a string or webelement" item)))
with
| :? CanopyElementNotFoundException as ex -> raise (CanopyNotDisplayedFailedException(sprintf "%s\r\nnotDisplay check for %O failed." ex.Message item))
Expand Down
38 changes: 0 additions & 38 deletions demotests/Program.fs

This file was deleted.

15 changes: 0 additions & 15 deletions demotests/app.config

This file was deleted.

82 changes: 0 additions & 82 deletions demotests/demotests.fsproj

This file was deleted.

6 changes: 2 additions & 4 deletions documentationtests/documentationtests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Numerics" />
<Reference Include="WebDriver">
<HintPath>..\packages\Selenium.WebDriver.2.38.0\lib\net40\WebDriver.dll</HintPath>
<Reference Include="WebDriver, Version=2.38.0.0, Culture=neutral, PublicKeyToken=null">
<Private>True</Private>
</Reference>
<Reference Include="WebDriver.Support">
<HintPath>..\packages\Selenium.Support.2.38.0\lib\net40\WebDriver.Support.dll</HintPath>
<Reference Include="WebDriver.Support, Version=2.38.0.0, Culture=neutral, PublicKeyToken=null">
<Private>True</Private>
</Reference>
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions documentationtests/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Selenium.Support" version="2.38.0" targetFramework="net40" />
<package id="Selenium.WebDriver" version="2.38.0" targetFramework="net40" />
<package id="Selenium.Support" version="2.39.0" targetFramework="net40" />
<package id="Selenium.WebDriver" version="2.39.0" targetFramework="net40" />
</packages>
58 changes: 0 additions & 58 deletions githubtests/Program.fs

This file was deleted.

15 changes: 0 additions & 15 deletions githubtests/app.config

This file was deleted.

Loading

0 comments on commit eb543ed

Please sign in to comment.