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))
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)
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))
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)
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)
def assert_content(componentName, content, componentInfo=None): marathon.assertContent(ComponentId(componentName, componentInfo), content)
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)
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)
def get_mcomponent(componentName, componentInfo=None): """Get the Java component represented by the given name""" return marathon.getMComponent(ComponentId(componentName, componentInfo))
def get_component(componentName): """Get the Java component represented by the given name""" return marathon.getComponent(ComponentId(componentName, None))
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)