-
Notifications
You must be signed in to change notification settings - Fork 2.3k
expose driver functionality #8
Comments
I'd considered this and wasn't sure what would be most intuitive to people - truly wrapping the driver, or keeping both around. I take this as a vote for the former, and I think I prefer that as well. I'd love to hear others' votes, too. |
I agree, I think keeping both around would be good. That way some e2e tests could simply use the driver for non-angular pages. Currently when I try to use them side by side like so: ptor.get("http://www.smashingmagazine.com");
driver.getTitle().then(function(title) {... It errors out:
After we fix that, maybe we just add a ptor.get("http://www.smashingmagazine.com");
ptor.driver.getTitle().then(function(title) {... Thoughts? EDIT: looks like there already is a |
Heya, Added full wrapping on the 'wrapfix' branch with 40d8a7a. Does this look sane (and fix your issue?) |
Hi Julie,
Furthermore, for chaining functions, your mixed in functions should return the protractor instance, and not the webdriver instance, e.g.
Does this make sense? |
Tobias - thanks for the comments, can't believe I forgot to fix the binding. However, on second thought, it might be best to really just delegate to webdriver, since there aren't any non-function members of the webdriver object that I want to copy to the protractor object. For example:
Any comments on this style? |
Alternative B: Decorate the webdriver instance, instead of creating a separate protractor object.
|
Implemented Tobias's suggestion (minus chaining, since there is no chaining in webdriverjs) with 1ef76dc |
Merged into master. Thanks for the comments, everyone! |
When wrapping a driver, shouldn't protractor expose the underlying driver methods as well as angular-specific ones? For example:
getTitle
is a method on the wrapped driver, but not available after being wrapped.The text was updated successfully, but these errors were encountered: