This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

pyfrank - python binding for iOS automation using frank.

pyfrank is an API to interact with frank, the iOS automation framework.

Installation

Option 1:

  1. Clone this repo or download the sources
  2. cd pyfrank
  3. python setup.py build
  4. sudo python setup.py install

Option 2:

sudo pip install pyfrank

#It’s that simple

from pyfrank import *

# We are running a simulator with frank locally on port 32765
device = Device(host='127.0.0.1', port=32765)

# Get the view representing a tab-bar button with the label "Mail"
view = device.getView(UiQuery("tabBarButton", {'marked': "Mail" }))

# Touch the button
response = view.touch()

if isinstance(response, Success):
    logging.info("Test mail button succeeded!");
elif isinstance(response, Failure):
    logging.error("Test mail button failed: %s", response)

#The object model

Device

The first entry point for interacting with frank. It’s constructor receives the host and the port of the frank enabled device.

Example:

from pyfrank import *

device = Device("127.0.0.1", 32765)

# Type text into the keyboard
device.typeIntoKeyboard("abc")

# Execute a method
device.appExec("methodSignature", "arg1", "arg2", ...)

# Get the accesibility state
accessibilityEnabled = device.accessibilityCheck()

# Get the device orientation
orientation = device.getOrientation()
if orientation == Orientation.PORTRAIT:
    print "Portrait"
elif orientation == Orientation.LANDSCAPE:
    print "Landscape"

# Get the application layout graph
dump = device.dump()

UiQuery

In frank views can be found using a special query language called “UiQuery”.

Example:

from pyfrank import *

UiQuery("view:'UIImageView' marked:'ProfilePicture'")

View

View allows to perform operations on the view(s) that match a UiQuery.

#Get the profile picture view
view = device.getView(UiQuery({'view': 'UIImageView'}, {'marked': 'ProfilePicture'}))

#Flash the profile picture
r = view.flash()

#Test for success
if isinstance(r, Success):
    print "Flashed the profile picture!"
else:
    print "Failed flashing profile picture"

#Touch the profile picture
r = view.touch()


#Get the title text input view
input = device.getView(UiQuery({'view', 'UITextField'}, {'marked': 'Title'}))

r = input.setText("New title text")

if isinstance(r, Success):
    print "Title input was changed successfully."
else:
    print "Failed changing title input"

Retrieve a view property

view = device.getView(UiQuery({'view':'UILabel'}, { 'marked':'Pull down to refresh...' }))

#
# Pull out the 'text' attribute.
r = view.text()

if isinstance(r, Success):
    labelText = r['results'][0]

    print "The text of the UILabel is", labelText
else:
    print "I seriously failed to retrieve the UILabel text attribute", r

Take a screenshot

device.screenshot(fileName='snapshot.jpg')

Run javascript code inside a WebView

view = device.getView(UiQuery('webView', { 'index':0 }))

# Fetch the URL from JS
url = view.stringByEvaluatingJavaScriptFromString('location.href').results()[0]
print "URL:", url

# Pop up an alert box
view.stringByEvaluatingJavaScriptFromString("alert('Hello from pyfrank!')")

#More information on frank

http://testingwithfrank.com/

Release History

Release History

0.2.8

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyfrank-0.2.8.tar.gz (9.9 kB) Copy SHA256 Checksum SHA256 Source Oct 25, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting