This repository was archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
chore(types): Inherit from webdriver.WebDriver types #4016
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sjelin
commented
Jan 27, 2017
@@ -811,7 +738,7 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver { | |||
* @returns {!webdriver.promise.Promise} A promise that will be resolved to | |||
* the located {@link webdriver.WebElement}. | |||
*/ | |||
findElement(locator: Locator): WebElement { | |||
findElement(locator: Locator): WebElementPromise { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been WebElementPromise
the whole time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should fix the JSDoc @returns
to reflect the same return type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
cnishina
suggested changes
Jan 30, 2017
@@ -811,7 +738,7 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver { | |||
* @returns {!webdriver.promise.Promise} A promise that will be resolved to | |||
* the located {@link webdriver.WebElement}. | |||
*/ | |||
findElement(locator: Locator): WebElement { | |||
findElement(locator: Locator): WebElementPromise { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should fix the JSDoc @returns
to reflect the same return type.
I decided to address this comment: angular#4000 (comment) While doing do I decided to take on this TODO: https://github.com/angular/protractor/blob/ccf02ab5f1070f0d7124318dc0099252f3c747e2/lib/browser.ts#L38 One possible issue here is that `ProtractorBrowser` only copies over methods, so it doesn't actually implement `WebDriver`'s interface. This isn't a problem right now, since `WebDriver`'s interface only has functions on it. But it could be a problem in the future.
cnishina
approved these changes
Jan 30, 2017
igniteram
pushed a commit
to igniteram/protractor
that referenced
this pull request
Feb 21, 2017
I decided to address this comment: angular#4000 (comment) While doing do I decided to take on this TODO: https://github.com/angular/protractor/blob/ccf02ab5f1070f0d7124318dc0099252f3c747e2/lib/browser.ts#L38 One possible issue here is that `ProtractorBrowser` only copies over methods, so it doesn't actually implement `WebDriver`'s interface. This isn't a problem right now, since `WebDriver`'s interface only has functions on it. But it could be a problem in the future.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I decided to address this comment:
#4000 (comment)
While doing do I decided to take on this TODO:
protractor/lib/browser.ts
Line 38 in ccf02ab
One possible issue here is that
ProtractorBrowser
only copies over methods, so it doesn't actuallyimplement
WebDriver
's interface. This isn't a problem right now, sinceWebDriver
's interfaceonly has functions on it. But it could be a problem in the future.
This is also weird in that
browser instanceof webdriver.WebDriver
is false but TypeScript probably thinks otherwise. An alternative option would be to do:Which would accomplish basically what the TODO suggested, but without ever actually inheriting from anyone