mojotech / pioneer

Integration Testing
MIT License
527 stars 35 forks source link

Extend promises with widget methods. #314

Open buob opened 9 years ago

buob commented 9 years ago

so instead of

this.find('.foo').then(function(el) {
  el.find('.bar').then(function(el) {
    el.click('.lee');
  });
});

We could just have

this.find('.foo').find('.bar').click('.lee');

We could do this by adding say a find method that would look basically like this:

this.find = function(args) {
  this.then(function(el) {
    el.find(args);
  });
};

So good or no good?

samccone commented 9 years ago

:) give it a go There is quite a bit of complexity involved in getting a fluent style api like ^ working, if you want to try to see if you can get it to work, i am totally :+1: