Exemple #1
0
def assert_p(component, property, value, componentInfo=None):
	"""Main marathon assertion function. Assert that the given value of the property matches that
		of the component currently in the application.
	"""

	marathon.assertProperty(ComponentId(component, componentInfo), property, value)
	assertion.addAssertion("Content", str(component))
Exemple #2
0
def keystroke(componentName, keysequence, componentInfo=None):
	"""Send the given keysequence to the application. Keysequence are
		of the form [modifier]+[modifier]+...+[keystroke]. If the given
		keysequence is a single character like 'A' - the corresponding
		keystroke (Shift+A) is sent to the application.
	"""

	marathon.keystroke(ComponentId(componentName, componentInfo), keysequence)
Exemple #3
0
def component_capture(fileName, windowName, componentName):
	"""Capture an image of the specified component and save it to the specified file."""
	return marathon.screenCapture(fileName, windowName, ComponentId(componentName, None))
Exemple #4
0
def get_po(component, property, componentInfo=None):
	"""Get a property for the given component. Note that what is returned is a Java object""" 

	return marathon.getPropertyObject(ComponentId(component, componentInfo), property)
Exemple #5
0
def get_p(component, property, componentInfo=None):
	"""Get a property for the given component. Note that what is returned is a String representation
		of the property"""

	return marathon.getProperty(ComponentId(component, componentInfo), property)
Exemple #6
0
def assert_content(componentName, content, componentInfo=None):
	marathon.assertContent(ComponentId(componentName, componentInfo), content)
Exemple #7
0
def wait_p(component, property, value, componentInfo=None):
	"""Main marathon assertion function. Assert that the given value of the property matches that
		of the component currently in the application.
	"""

	marathon.waitProperty(ComponentId(component, componentInfo), property, value)
Exemple #8
0
def drag_and_drop(source, sourceinfo, target, targetinfo, action):
	"""Recording sequence for a drag and drop operation. Marathon uses a Clipboard copy and paste
		to perform the operation.
	"""

	marathon.dragAndDrop(ComponentId(source, sourceinfo), ComponentId(target, targetinfo), action)
Exemple #9
0
def get_mcomponent(componentName, componentInfo=None):
	"""Get the Java component represented by the given name"""

	return marathon.getMComponent(ComponentId(componentName, componentInfo))
Exemple #10
0
def get_component(componentName):
	"""Get the Java component represented by the given name"""

	return marathon.getComponent(ComponentId(componentName, None))
Exemple #11
0
def select(componentName, text, componentInfo=None):
	"""Select a given component and set the state corresponding to the given text."""

	marathon.select(ComponentId(componentName, componentInfo), text)