Skip to content

Instantly share code, notes, and snippets.

@lightsofapollo
Created April 30, 2012 15:05
Show Gist options
  • Save lightsofapollo/2559076 to your computer and use it in GitHub Desktop.
Save lightsofapollo/2559076 to your computer and use it in GitHub Desktop.
dsl
//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){
//you have the text
});
});
});
//With generators I want to do something like this
yield device.startSession();
yield device.goUrl('http://google.com');
//without chaining
var body = yield device.findElement('body');
text = yield body.text();
//do stuff with text
//with chaining
var text = yield device.findElement('body').text();
//do stuff with text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment