Canopy.Mobile


core

Namespace: canopy.mobile

Contains all canopy core functions.

Nested types and modules

TypeDescription
AndroidSettings

Functions and values

Function or valueDescription
( != ) selector value
Signature: selector:string -> value:string -> unit

Check that an element does not have a specific value

CompiledName: op_BangEquals

( << ) selector text
Signature: selector:string -> text:string -> unit

Writes the given text into the element that was found by the given selector and waits until the text was completely entered. After running this function the keyboard will be closed.

CompiledName: op_ComposeLeft

( == ) selector value
Signature: selector:string -> value:string -> unit

Check that an element has a specific value

CompiledName: op_EqualsEquals

androidHome
Signature: Lazy<string>
back ()
Signature: unit -> unit

Clicks the Android back button. If the keyboard is still open this function hides it.

backAndWait waitSelector
Signature: waitSelector:string -> unit

Clicks the Android back button and waits for the waitSelector to appear.

click selector
Signature: selector:string -> unit

Clicks the first element that is found with the selector. If a text input is focused, this function clicks the button twice in order to get the focus.

clickAndWait clickSelector waitSelector
Signature: clickSelector:string -> waitSelector:string -> unit

Clicks an element and waits for the waitSelector to appear.

DefaultAndroidSettings
Signature: AndroidSettings
DescribeCurrentView ()
Signature: unit -> unit

Prints a description of the current view on the console

displayed selector
Signature: selector:string -> unit

Check that an element exists and is displayed.

driver
Signature: AndroidDriver<IWebElement>
emulatorStarted
Signature: bool
exists selector
Signature: selector:string -> bool

Returns true when the selector matches an element on the current page or otherwise false.

find selector
Signature: selector:string -> IWebElement

Returns the first element that matches the given selector.

findAll selector
Signature: selector:string -> IWebElement list

Returns all elements for a given selector.

findAllBy by
Signature: by:By -> IWebElement list

Returns all elements for a given By - without timeout

findAllByNow by
Signature: by:By -> IWebElement list
findAllSelector
Signature: string
findBy by
Signature: by:By -> IWebElement

Returns the first element for a given By.

first selector
Signature: selector:string -> IWebElement

Gets the first element with the given selector. Index starts at 1.

getAllElements ()
Signature: unit -> IWebElement list

Returns all elements on the current page.

GetAllElementSelectors ()
Signature: unit -> string list

Returns all selectors for all elements the current page.

getAllTexts ()
Signature: unit -> IWebElement list

Returns all elements with text on the current page.

getAndroidCapabilities settings appName
Signature: settings:AndroidSettings -> appName:'?7182 -> DesiredCapabilities
Type parameters: '?7182
getDeviceCapabilities appName
Signature: appName:'?7187 -> DesiredCapabilities
Type parameters: '?7187
GetSuggestions selector
Signature: selector:string -> string list

Returns similar elements for a given selector

hideKeyboard ()
Signature: unit -> unit

Hides the keyboard if it is open

home
Signature: int
isAndroidEmulatorRunning ()
Signature: unit -> bool

Checks whether an Android emulator is already running

landscape ()
Signature: unit -> unit

Set Orientation to Landscape

last selector
Signature: selector:string -> IWebElement

Gets the last element with the given selector. Index starts at 1.

longPress key
Signature: key:int -> unit

Long press a key

longPressMeta key
Signature: key:int -> unit

Long press a key with meta state

notDisplayed selector
Signature: selector:string -> unit

Check that an element exists but is not displayed.

nth n selector
Signature: n:int -> selector:string -> IWebElement

Gets the nth element with the given selector. Index starts at 1.

orientation orientation
Signature: orientation:ScreenOrientation -> unit

Set Orientation

portrait ()
Signature: unit -> unit

Set Orientation to Portrait

press key
Signature: key:int -> unit

Press a key

pressMeta key
Signature: key:int -> unit

Press a key with meta state

quit ()
Signature: unit -> unit

Quits the web driver and appium

read selector
Signature: selector:string -> string

Reads the text from the given selector

screenshot path fileName
Signature: path:string -> fileName:string -> unit

Takes a screenshot of the emulator and saves it as png.

sleep seconds
Signature: seconds:float -> unit

Sleeps for x seconds.

space
Signature: int
start settings appName
Signature: settings:AndroidSettings -> appName:'?7185 -> unit
Type parameters: '?7185

Starts the webdriver with the given app.

startEmulator settings
Signature: settings:AndroidSettings -> unit

Start an emulator process

startOnDevice appName
Signature: appName:'?7189 -> unit
Type parameters: '?7189

Starts the given app on a device

stopEmulator ()
Signature: unit -> unit

Stops the emulator process that was started with canopy mobile

tryFind selector
Signature: selector:string -> IWebElement option

Returns the first element that matches the given selector or None if no such element exists right now.

tryFindBy by
Signature: by:By -> IWebElement option

Returns the first element for a given By or None if no such element exists right now.

waitFor selector
Signature: selector:string -> unit

Waits until the given selector returns an element or throws an exception when the timeout is reached.

write selector text
Signature: selector:string -> text:string -> unit

Writes the given text into the element that was found by the given selector and waits until the text was completely entered. After running this function the keyboard will be closed.

writeIntoElement (...)
Signature: closeKeyboard:bool -> selector:string -> text:string -> unit

Writes the given text into the element that was found by the given selector and waits until the text was completely entered.

Fork me on GitHub