Giter Club home page Giter Club logo

spade's Introduction

spade

Spade is a native iOS and Android module for Titanium which allows you to inject events into your application. It is one component of a system for automated user interface testing for Titanium apps. This is accomplished with Square's Keep It Functional on iPhone and Jayway's Robotium on Android.

Currently, this is not a test framework; it is just a collection of functions which can be used to inject events. The module provides the following functions on both iOS and Android:

tap (view)

Tap a view in the center.

tapAt (view, point)

Tap a view at a set of coordinates in relation to the view.

drag (view, from, to)

Drag along a view, again, local coords.

visible (view)

Check if a view is visible on screen.

type (view, string)

Attempt to type the specified string into the specified view.

tapText (string)

Search for a view displaying the given string and tap it if found. The string argument will be interpereted internally as a regex.

Usage

You can extract the module zip files into your project directory and edit the tiapp.xml file. Then, do something like this

var spade = require('org.russfrank.spade');

var win = Ti.UI.createWindow();
var button = Ti.UI.createButton({title: 'hello'});
win.add(button);
win.open();

button.addEventListener('click', function () { Ti.API.debug('world') });

setTimeout(function () {
  spade.tap(button);
}, 5000);

After five seconds, you should see 'world' in your console.

Future

The functionality of this module is currently very limited; for use in a real testing situation, it still needs the ability to press buttons on Android, enter text, search for views, etc.

This isn't all that difficult though. The frameworks I chose are pretty featureful.

After that, it needs some kindof harness. Appcelerator's Drillbit might do for this.

Note about the Apple App Store

Your app will be rejected if you submit it with this module linked in. This should be obvious.

License

My additions are MIT. Jayway and KIF are both Apache 2, the LICENSEs / NOTICEs are in the project directories where I used those projects.

spade's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.