Canopy.Mobile


Actions

start

Starts a new emulator session with the given apk.

1: 
start DefaultAndroidSettings "myApp.apk"

quit

Quit the current emulator session.

1: 
quit ()

<< (write)

Writes text to element.

1: 
2: 
3: 
"#firstName" << "Alex"
//if you dont like the << syntax you can use the write function:
write "#firstName" "Alex"

read

Reads the text of an element.

1: 
2: 
let firstName = read "#firstName"
let linkText = read "#someLink"

click

Clicks an element via selector.

1: 
2: 
click "#login"
click "menu-tv:search"

clickAndWait

Clicks an element via selector and waits for another selector to appear.

1: 
clickAndWait "#login" "tv:password"

back

Clicks the android back button.

1: 
back ()

backAndWait

Clicks the android back button and waits for a selector to appear.

1: 
backAndWait "#login"

landscape

Sets the orientation to landscape.

1: 
landscape()

portrait

Sets the orientation to portrait.

1: 
portrait()

hideKeyboard

Hides the keyboard if it is open.

1: 
hideKeyboard()

sleep

Sleeps for x seconds.

1: 
2: 
sleep 3
sleep 5
Fork me on GitHub