-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(mobile): add extended wd commands for appium #3326
Conversation
|
Had to add a lot of types to promises to get everything to compile |
|
Can we split this into two PRs, one to add the promise types and one to actually do the extend webdriver business? |
|
I believe this is unblocked now, changing labels. |
|
Yeah, it was broken, not blocked. Should be fixed now. We'll see what travis says in the morning. |
|
But honestly it's probably gonna need some cleaning regardless |
|
Just gonna make sure I didn't screw up doc generation and then this PR will be good to go |
|
@juliemr ready for review |
lib/browser.ts
Outdated
| try { | ||
| extendWDInstance = extendWD(webdriverInstance); | ||
| } catch (e) { | ||
| // Must not have a driver that can be extended (e.g. directly provided) |
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.
What does 'directly provided' mean here? Can you add to the comment?
|
I'll take a look at this today... |
| * @type {ExtendedWebDriver} | ||
| */ | ||
| driver: WebDriver; | ||
| driver: ExtendedWebDriver; |
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.
Looks like this is taken care of. This does not appear to have typing implications.
da69654 to
09c3ddc
Compare
|
@cnishina can I get a re-review? |
lib/browser.ts
Outdated
| opt_message?: string) => wdpromise.Promise<any>; | ||
| } | ||
|
|
||
| export class ExtendedWebdriver { |
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.
Nit on naming: We are importing ExtendedWebDriver interface and also have an ExtendedWebdriver class? By chance could this class be called something else? I almost thought these were the same thing because they differ by d vs D. Maybe WebDriverExtended?
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.
Also, should this extend Webdriver above?
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.
- For consistency, I'll rename
WebdrivertoAbstractWebDriverand this toAbstractExtendedWebDriver - Yes
| * @alias browser | ||
| * @constructor | ||
| * @extends {webdriver.WebDriver} | ||
| * @extends {webdriver_extensions.ExtendedWebDriver} |
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 extends the class above and not really the webdriver_extensions
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.
In order for js doc to work, this is the correct type (see old version pointing to webdriver.WebDriver not Webdriver)
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.
I see. Alright, that makes sense.
lib/browser.ts
Outdated
| return new ProtractorBrowser(webdriver, baseUrl, rootElement, untrackOutstandingTimeouts); | ||
| } | ||
|
|
||
| // Extended webdriver methods |
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.
Should we remove this comment since there are no methods?
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.
Yes :P
sjelin
left a comment
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.
replied to comments, will implement in a second
| * @alias browser | ||
| * @constructor | ||
| * @extends {webdriver.WebDriver} | ||
| * @extends {webdriver_extensions.ExtendedWebDriver} |
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.
In order for js doc to work, this is the correct type (see old version pointing to webdriver.WebDriver not Webdriver)
lib/browser.ts
Outdated
| return new ProtractorBrowser(webdriver, baseUrl, rootElement, untrackOutstandingTimeouts); | ||
| } | ||
|
|
||
| // Extended webdriver methods |
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.
Yes :P
lib/browser.ts
Outdated
| opt_message?: string) => wdpromise.Promise<any>; | ||
| } | ||
|
|
||
| export class ExtendedWebdriver { |
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.
- For consistency, I'll rename
WebdrivertoAbstractWebDriverand this toAbstractExtendedWebDriver - Yes
|
Please rebase with changes. |
|
All comments addressed |
6499713 to
6a1f627
Compare
Had to make some minor changes to the website to handle longer inheritance chains
| // have to be removed. | ||
| patch( | ||
| require('selenium-webdriver/lib/command'), require('selenium-webdriver/executors'), | ||
| require('selenium-webdriver/http')); |
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.
with the new types, could we import these with
import * as http from 'selenium-webdriver/http';
import * as executors from 'selenium-webdriver/executors';
?
|
Closed in favor of #3860 |


No description provided.