These are chat archives for mojotech/pioneer

20th
May 2015
Jarid Margolin
@jaridmargolin
May 20 2015 00:05
If it just needs access to driver, I'd be fine passing the env into my widget at the time of instantiation new MyWidget(this, options);. Gives me easier subclassing and less verbose widget boiler.
module.exports = Widget.List.extend({
  root: "#todo-list"
});
Tom Hicks
@tomhicks
May 20 2015 00:07
Completely agree. I think cucumber encourages this odd 'global' step scope thinking
Whereas injecting dependencies is a better approach. We've been playing with Galen framework for layout testing, and we'd be able to share a lot of code across widgets more easily if it wasn't for this style
Jarid Margolin
@jaridmargolin
May 20 2015 00:13
I actually think you could avoid passing the env in at instantiation as well due to javascripts prototypal nature. You could actually add the env to the base Widget prototype during setup. All subclasses would then have access to it.
But yes, I've been trying to get used to the massive global nature of cucumber. I'm finding as my test suite continues to grow larger, my step definitions are forced to get more specific in order to avoid collisions
Tom Hicks
@tomhicks
May 20 2015 00:15
I still prefer injection over hanging it off the prototype but it's no biggie either way really.
Yeah completely agree
It's really hard to understand how cucumber would really like you to do it. With an app with hundreds of features you basically just have to hope you don't collide!
Jarid Margolin
@jaridmargolin
May 20 2015 00:19
Pioneer does allow specifying the require and feature flags. So if you deemed it worthy, you could create a wrapper around pioneer to run certain tests in isolation
Tom Hicks
@tomhicks
May 20 2015 00:21
Yeah sure. It doesn't feel like you're doing cucumber quite right then! But I get what you're saying
Jarid Margolin
@jaridmargolin
May 20 2015 00:27
Well I wonder if @samccone would entertain the idea of hanging it off the prototype. The plus side here is it could be done in a non breaking manner. Where passing it would require everyone to update their widget instantiation signature
Sam Saccone
@samccone
May 20 2015 13:26
Completely agree. I think cucumber encourages this odd 'global' step scope thinking
yeah cucumber really forced my hand initially
:(
so step one… is to extract the widgets
make them normal “require” things
Steven Langbroek
@StevenLangbroek
May 20 2015 13:41
so, where do i find the docs for the @driver api?
thought it was http://webdriver.io/
which it isn't :D
as in: @driver.pause() doesn't work
have fun
Steven Langbroek
@StevenLangbroek
May 20 2015 14:38
omfg
that is horrible documentation
dammit, i was hoping that wasn't the one
Tom Hicks
@tomhicks
May 20 2015 20:30
I usually end up using Java or Python examples then playing guess the JavaScript API method name
Sam Saccone
@samccone
May 20 2015 20:33
same
:crying_cat_face:
Tom Hicks
@tomhicks
May 20 2015 20:34
Haha glad it's not just me!