dalekjs / dalek-internal-webdriver

[unmaintained] Webdriver bindings for DalekJS
MIT License
4 stars 5 forks source link

Be able to access the window object of the testing page #4

Closed ryanzec closed 11 years ago

ryanzec commented 11 years ago

In order to be able to integrate DalekJS more closely with 3rd party libraries/framework (the ability to create framework specific functionality which would be especially useful for MV* frameworks) it should be possible to gain access to the window/document object (for both actions and assertions). For example the Angular object is attached to the document of the page so if we had access to that, we could do AngularJS specific things.

Since I don't have a lot of experience working with the JSON Wire Protocol, I am not 100% sure if this is possible although I know the Protractor (https://github.com/angular/protractor) does this and it uses selenium's webdriverjs under the hood (which uses the JSON Wire Protocol).

asciidisco commented 11 years ago

This is now possible with the execute & waitFor methods.

Hidden gem, try:

.execute(function () {
  this.assert.ok(true, 'In browser assertion');
})

to use an in browser assertion.