Configuration

driverHostName

  • .net core has a delay when resolving localhost that makes using canopy very slow
  • canopy uses 127.0.0.1 instead but allows you to adjust it based on your ipv/ipv6 needs
  • Defaults to "127.0.0.1"
1: 
2: 
driverHostName <- "localhost"
driverHostName <- "::1"

chromeDir

  • Directory for the chromedriver
  • Defaults executing directory (bin\Debug in many cases)
1: 
chromeDir <- @"C:\your\custom\path"

chromiumDir

  • Directory for the chromedriver for use with chromium
  • Defaults to pre-set OS paths
  • nix: /usr/lib/chromium-browser
  • Windows: C:\
1: 
chromiumDir <- "C:\\"

firefoxDir

  • Install path for firefox
  • Defaults to pre-set OS paths
  • OSX: /Applications/Firefox.app/Contents/MacOS/firefox-bin
  • nix: /usr/lib/firefox/firefox
  • Windows: C:\Program Files (x86)\Mozilla Firefox\firefox.exe
1: 
firefoxDir <- @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"

firefoxDriverDir

  • Directory for the firefox gecko driver
  • Defaults executing directory (bin\Debug in many cases)
1: 
firefoxDriverDir <- @"C:\your\custom\path"

ieDir

  • Directory for Internet Explorer
  • Defaults executing directory (bin\Debug in many cases)
1: 
ieDir <- @"C:\your\custom\path"

safariDir

  • Directory for Safari
  • Defaults executing directory (bin\Debug in many cases)
1: 
safariDir <- @"C:\your\custom\path"

edgeDir

  • Directory for edge driver
  • Defaults to C:\Program Files (x86)\Microsoft Web Driver\
1: 
edgeDir <- @"C:\your\custom\path"

hideCommandPromptWindow

  • Hide drivers command prompt window
  • Defaults to false
1: 
hideCommandPromptWindow <- true

elementTimeout

  • Amount of time for the test runner to search for an element.
  • Default is 10.0 seconds
1: 
elementTimeout <- 10.0

compareTimeout

  • Amount of time for the test runner to spend comparing elements.
  • Default is 10.0 seconds
1: 
compareTimeout <- 10.0

pageTimeout

  • Amount of time for the test runner to wait for the page to load.
  • Default is 10.0 seconds
1: 
pageTimeout <- 10.0

wipSleep

  • Amount of time to spend between WIP tests (Tests marked with &&&&)
  • Default is 1.0 seconds
1: 
wipSleep <- 1.0

failIfAnyWipTests

  • Prevents accidentally allowing wip tests into the build pipeline.
  • Set to false locally so tests under development are not affected.
  • Set to true in your CI environment to catch wip tests that have been mistakenly commited to trunk/master.
  • Default is false
1: 
failIfAnyWipTests <- true

runFailedContextsFirst

  • Runs failed contexts first if the test suite has already executed.
  • Defaults is false
1: 
runFailedContextsFirst <- false

failFast

  • Stop running test suite after one test fails.
  • Defaults is false
1: 
failFast := true

failScreenshotPath

  • The path to save screenshots that are taken on failure.
  • Defaults is AppData\canopy
1: 
failScreenshotPath <- "C:\path\to\screenshot\folder"

failScreenshotFileName

  • Function that is run to create the filename of screenshot.
  • Takes a test and a suite to be optionally used in name creation.
  • Defaults is Timestamp with format MMM-d_HH-mm-ss-fff
1: 
failScreenshotFileName <- fun test suite -> System.DateTime.Now.ToString("MMM-d_HH-mm")

reporter

  • Reporter object that will handle how logs should be stored.
  • Must inherit IReporter
  • Default is ConsoleReporter
1: 
reporter <- new reporters.ConsoleReporter() :> IReporter

disableSuggestOtherSelectors

  • Option that will disable selector suggestion if a selector fails to execute
  • Defaults is false
1: 
disableSuggestOtherSelectors <- false

autoPinBrowserRightOnLaunch

  • Automatically pins the browser to the right of the screen on launch
  • Default is true
1: 
autoPinBrowserRightOnLaunch <- true

throwIfMoreThanOneElement

  • Throws a CanopyMoreThanOneElementFoundException if more than one element is found using a selector
  • Default is false
1: 
throwIfMoreThanOneElement <- false

configuredFinders

  • Defines functions for finding elements based on selectors
  • Default is the following sequence
  • findByCss
  • findByValue
  • findByXpath
  • findByLabel
  • findByText
  • findByJQuery
1: 
configuredFinders <- finders.defaultFinders

optimizeBySkippingIFrameCheck

  • If you need your tests to be faster and don't have any iframes you can turn this to true
  • Default is false
1: 
optimizeBySkippingIFrameCheck <- false

showInfoDiv

  • Allows information to be displayed on the browser when the puts function is called
  • Default is true
1: 
showInfoDiv <- true

failureScreenshotsEnabled

  • Enables/Disables automatic taking of screenshot on failures.
  • Default is true
1: 
failureScreenshotsEnabled <- false

skipAllTestsOnFailure

  • Like fail fast, but instead of not running tests, it skips them.
  • Default is false
1: 
skipAllTestsOnFailure <- true

skipRemainingTestsInContextOnFailure

  • Like skipAllTestsOnFailure, but only skip those in the current context.
  • Default is false
1: 
skipRemainingTestsInContextOnFailure <- true

skipNextTest

  • Skip the next test
  • Default is false
1: 
skipNextTest <- true

failureMessagesThatShoulBeTreatedAsSkip

  • Mark a failed test as skipped if it failed for any of the listed known reasons
  • Default is empty list
1: 
failureMessagesThatShoulBeTreatedAsSkip <- ["message 1"; "message 2"]

webdriverPort

  • Allow specifying a port on which the WebDriver instance wil start (instead of a random one)
  • Defualt is None and it must be an Option type, i.e. None or Some x
  • Do NOT use if running tests in parallel!
1: 
webdriverPort <- Some 4444

acceptInsecureSslCerts

  • Allow the driver to navigate to sites with self-signed SSL certificates
  • Crucial for Chrome Headless testing
  • Default is true
1: 
acceptInsecureSslCerts <- true
namespace canopy
module configuration

from canopy
module types

from canopy
namespace canopy.runner
module classic

from canopy.runner
val mutable driverHostName : string
val mutable chromeDir : string
val mutable chromiumDir : string
val mutable firefoxDir : string
val mutable firefoxDriverDir : string
val mutable ieDir : string
val mutable safariDir : string
val mutable edgeDir : string
val mutable hideCommandPromptWindow : bool
val mutable elementTimeout : float
val mutable compareTimeout : float
val mutable pageTimeout : float
val mutable wipSleep : float
val mutable failIfAnyWipTests : bool
val mutable runFailedContextsFirst : bool
val failFast : bool ref
val mutable failScreenshotPath : string
val mutable failScreenshotFileName : (Test -> suite -> string)
val test : Test
Multiple items
val suite : suite

--------------------
type suite =
  new : unit -> suite
  member Clone : unit -> suite
  member After : (unit -> unit)
  member Always : Test list
  member Before : (unit -> unit)
  member Context : string
  member IsParallel : bool
  member Lastly : (unit -> unit)
  member Manys : Test list
  member OnFail : (unit -> unit)
  ...

--------------------
new : unit -> suite
namespace System
Multiple items
type DateTime =
  struct
    new : ticks:int64 -> DateTime + 10 overloads
    member Add : value:TimeSpan -> DateTime
    member AddDays : value:float -> DateTime
    member AddHours : value:float -> DateTime
    member AddMilliseconds : value:float -> DateTime
    member AddMinutes : value:float -> DateTime
    member AddMonths : months:int -> DateTime
    member AddSeconds : value:float -> DateTime
    member AddTicks : value:int64 -> DateTime
    member AddYears : value:int -> DateTime
    ...
  end

--------------------
System.DateTime ()
   (+0 other overloads)
System.DateTime(ticks: int64) : System.DateTime
   (+0 other overloads)
System.DateTime(ticks: int64, kind: System.DateTimeKind) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, calendar: System.Globalization.Calendar) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, kind: System.DateTimeKind) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, calendar: System.Globalization.Calendar) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int, kind: System.DateTimeKind) : System.DateTime
   (+0 other overloads)
property System.DateTime.Now: System.DateTime
System.DateTime.ToString() : string
System.DateTime.ToString(provider: System.IFormatProvider) : string
System.DateTime.ToString(format: string) : string
System.DateTime.ToString(format: string, provider: System.IFormatProvider) : string
val mutable reporter : IReporter
module reporters

from canopy
Multiple items
type ConsoleReporter =
  interface IReporter
  new : unit -> ConsoleReporter

--------------------
new : unit -> reporters.ConsoleReporter
type IReporter =
  interface
    abstract member contextEnd : string -> unit
    abstract member contextStart : string -> unit
    abstract member describe : string -> unit
    abstract member fail : Exception -> string -> byte [] -> string -> unit
    abstract member pass : string -> unit
    abstract member quit : unit -> unit
    abstract member setEnvironment : string -> unit
    abstract member skip : string -> unit
    abstract member suggestSelectors : string -> string list -> unit
    abstract member suiteBegin : unit -> unit
    ...
  end
val mutable disableSuggestOtherSelectors : bool
val mutable autoPinBrowserRightOnLaunch : bool
val mutable throwIfMoreThanOneElement : bool
val mutable configuredFinders : (string -> (OpenQA.Selenium.By -> System.Collections.ObjectModel.ReadOnlyCollection<OpenQA.Selenium.IWebElement>) -> OpenQA.Selenium.IWebDriver -> seq<OpenQA.Selenium.IWebElement list>)
module finders

from canopy
val mutable defaultFinders : (string -> (OpenQA.Selenium.By -> System.Collections.ObjectModel.ReadOnlyCollection<OpenQA.Selenium.IWebElement>) -> OpenQA.Selenium.IWebDriver -> seq<OpenQA.Selenium.IWebElement list>)
val mutable optimizeBySkippingIFrameCheck : bool
val mutable showInfoDiv : bool
val mutable failureScreenshotsEnabled : bool
val mutable skipAllTestsOnFailure : bool
val mutable skipRemainingTestsInContextOnFailure : bool
val mutable skipNextTest : bool
val mutable failureMessagesThatShoulBeTreatedAsSkip : string list
val mutable webdriverPort : int option
union case Option.Some: Value: 'T -> Option<'T>
val mutable acceptInsecureSslCerts : bool