Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Support alternate browser interfaces #164

Closed
jkrems opened this issue Aug 20, 2015 · 3 comments
Closed

Support alternate browser interfaces #164

jkrems opened this issue Aug 20, 2015 · 3 comments

Comments

@jkrems
Copy link
Contributor

jkrems commented Aug 20, 2015

Now that ES6 is trickling into node, mocha has built-in promise, etc., the world has changed a bit, making non-http-sync tests more interesting. What I would like to explore is a wd-like setup where the user is free to chose an interface (http-sync, promise chains, callbacks). With injectBrowser(options) we already have a pretty nice place to do such branching. We could leverage wd for the other modes, even though that makes the API a little inconsistent unfortunately.

I think there's still a lot of value in testium (e.g. orchestrating the app, phantomjs, selenium, ...) without the detail of how the browser API works. My hope is that adding support for a wd interface will allow us to make it available to more people. And, if I'm allowed to dream, it might help reduce "random" test timeout issues in long test suites.

@EndangeredMassa
Copy link
Collaborator

I still prefer a sync API over promises. What in ES6 makes sync less important or desirable?

I agree that testium can still have a lot of value orchestrating everything. It would be cool to offer different APIs so that users can choose.

@jkrems
Copy link
Contributor Author

jkrems commented Aug 21, 2015

With iojs (and latest coffee-script) generators become an option. Throw in a quick mocha helper to turn generator functions into async functions (e.g. using Bluebird.coroutine) and you have sync-like syntax. You have the overhead of additional yields everywhere but the advantage is that you use node "as ryan intended".

I wouldn't want to replace the sync syntax (not the least of the reasons is that the migration story would be awful otherwise), it's purely about creating an option to chose. I'm about to try out what it would take to make it work. I'm really hoping the impact would be minimal (apart from the obvious code bloat).

@jkrems
Copy link
Contributor Author

jkrems commented Oct 28, 2015

Now supported. There's some unreleased work towards full parity (testiumjs/testium-driver-wd#4) but the general work is done.

@jkrems jkrems closed this as completed Oct 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants