Skip to content

Instantly share code, notes, and snippets.

View lightsofapollo's full-sized avatar

James Lal lightsofapollo

View GitHub Profile
//fails
myFunc(
someArg
);
//passes
myFunc(
myArg
);
127.0.0.1 gaiamobile.org
127.0.0.1 homescreen.gaiamobile.org
127.0.0.1 dialer.gaiamobile.org
127.0.0.1 sms.gaiamobile.org
127.0.0.1 browser.gaiamobile.org
127.0.0.1 maps.gaiamobile.org
127.0.0.1 camera.gaiamobile.org
127.0.0.1 gallery.gaiamobile.org
127.0.0.1 video.gaiamobile.org
127.0.0.1 market.gaiamobile.org
@lightsofapollo
lightsofapollo / hack.js
Created April 30, 2012 14:49
generator hack for mocha tests (don't use this code)
var globals = [
'suiteSetup',
'test'
];
var Task = (function() {
var current, done;
return {
start: function(generator, cb) {
//right now you can do this.
var device = new Marionette.Client();
device.startSession(function(){
var body, text;
device.
goUrl('http://google.com', function(){ //result of command }).
findElement('body', function(el){
el.text(function(text){
@lightsofapollo
lightsofapollo / gist:2559125
Created April 30, 2012 15:12
marionette.js
yield device.startSession();
function remoteScript() {
return window.location;
}
var result = yield device.executeScript(remoteScript);
@lightsofapollo
lightsofapollo / github.js
Created April 30, 2012 16:51
marionette example test
suite('github.com', function() {
var device;
startMarionette(function(client) {
device = client;
});
suite('github', function() {
suiteSetup(function() {
function startMarionette() {
suiteSetup(function() {
this.timeout(10000);
var driver = new Marionette.Drivers.HttpdPolling();
yield driver.connect(Task.next);
device = new Marionette.Client(driver, {
defaultCallback: Task.next
});
yield device.startSession();
});
test('my thing', function() {
this.timeout(4000);
//run stuff
});
@lightsofapollo
lightsofapollo / tcp.js
Created May 8, 2012 21:16
TCP Example
var Abstract, CommandStream;
Abstract = require('./abstract').Marionette.Drivers.Abstract;
CommandStream = require('../../node/command-stream');
/** TCP **/
Tcp.Socket = require('net').Socket;
function Tcp(options) {
if (typeof(options)) {
var Example = (function(){
return {
math: function() {
},
complexMethod: function() {
}
}