opitzconsulting / uitest.js

uitest.js is able to load a webpage into a frame, instrument that page and the javascript in that page (e.g. add additional scripts at the end of the document, ...) and execute actions on that page.
MIT License
67 stars 8 forks source link

Configuration options for angular integration #16

Open jperl opened 11 years ago

jperl commented 11 years ago

Right now I have this line commented out because the application already uses angular.mock.e2e.$httpBackendDecorator and the mocks get overridden if I leave it there.

It would be a nice to be able to pass configuration options to features.

tbosch commented 11 years ago

Yes, good idea. What do you think about the following:

By this, we can still pass multiple features to one call of feature.

Tobias

jperl commented 11 years ago

I like that a lot

jperl commented 11 years ago

What about instead: feature(name, [config]). Config would be an optional parameter so you could call

That way you do not need to pollute the config with a name property and you can call it the same way as now.

tbosch commented 11 years ago

Yes, true. However, right now, feature accepts a list of features, e.g. feature('xhrSensor', 'timeoutSensor', ...). To keep this property, the object notation would be better... Mmmh..

Tobais

jperl commented 11 years ago

Got it that makes a lot of sense. I agree with feature({name: 'someComplexFeature', configProp1: 1, ...}