dalekjs / dalek

[unmaintained] DalekJS Base framework
MIT License
695 stars 63 forks source link

Allow DalekJS to use Protractor as a library #97

Open deedubbleyoo opened 10 years ago

deedubbleyoo commented 10 years ago

Protractor's AngularJS are great for testing ng apps, however my team and I are becoming increasingly frustrated with Protractor CLI's use of selenium, with all its myriad complexity and baffling stack traces.

As per conversation on Twitter, protractor can be used just as a library (https://t.co/E6pu2enQJr), so it would be good if DalekJS could be wrapped by protractor to make use of the extra angular selectors.

I can then start working on a POC to migrate our project to DalekJS!

I'd also like to help contribute to the project so any pointers for a noob on where to start would be great!

asciidisco commented 10 years ago

That is an interesting question/use case, indeed.

I believe the APIs of Protractor & DalekJS can be unified, when it comes down to wrapping a browser driver, if anyone could give me a hint on where to find the ´driver´ "interface" of protractor, I would try to make a branch of dalek-browser-chrome & try get it up & running with protractor APIs.

deedubbleyoo commented 10 years ago

From what little I know of protractor's internals, this is the function that wraps a webdriver instance: https://github.com/angular/protractor/blob/f23565d5db4fbb102cfec8311ce9dfaee52e9113/lib/protractor.js#L1161 My understanding is that each protractor instance 'pulls in' the webdriver commands and makes them its own.

Having done this is in the past with normal selenium-webdriver, Protractor needs to know the webdriver instance - I instantiated the instance then simply passed that to protractor as per the example in the previous link, it was painless.

So assuming dalek.js has a faithful webdriver implementation (although obvs not implementing selenium in the back) then it should be able to wrap its commands and add in the extra angular sugar?

asciidisco commented 10 years ago

We are tackling this as part if our DalekJS hackathon by the end of next month; at least we will provide a pluggable API to make it possible to tie this in.

deedubbleyoo commented 10 years ago

Awesome news, I look forward to seeing what comes of the Hackathon!

deedubbleyoo commented 10 years ago

Hi, did anything come out of this short-term, or is this part of the wider API changes now?