mojotech / pioneer

Integration Testing
MIT License
527 stars 35 forks source link

Make pioneer widgets modular #308

Open buob opened 9 years ago

buob commented 9 years ago

I want to be able to require a certain class outside of cucumber

samccone commented 9 years ago

yes, we talked about how to do this IRL, it will require a change to the pioneer build phase and a but of shuffling around of the classes, however it should not be so hard. @buob are you interested in doing this?

buob commented 9 years ago

Sure. Let's leave it unassigned for now though in case someone else gets to it before I do.

samccone commented 9 years ago

Would you like to outline the approach here so that someone else could possibly pick this up. Currently the issue does not really explain the Why or How very well.

buob commented 9 years ago

Why?

The most valuable part of pioneer is the widget abstraction. I should be able to use that separate from all of the runner, gherkin, etc. pieces. For example, in my plain old javascript file, something like:

module.exports = require('pioneer/widget').extend({
    root: '.foo',

    welcomeMessage: function() {
      return this.find('.welcome');
    }
});

How?

Alter the build so that it builds each component separately, and then in the cucumber side of things, require those and invoke them.

samccone commented 9 years ago

yep :+1: this is the way to do it