-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(driverProviders): clean up driver provider q usage #5034
chore(driverProviders): clean up driver provider q usage #5034
Conversation
cnishina
commented
Nov 12, 2018
- Remove driverProviderUseExistingWebDriver since the generation of the selenium server is already accomplished when providing a selenium address in driverProvider.ts. Also clean up docs and tests.
- Use native promises over q promises.
12195c1
to
8b1f1db
Compare
caea081
to
7ff7d2d
Compare
- Remove driverProviderUseExistingWebDriver since the generation of the selenium server is already accomplished when providing a selenium address in driverProvider.ts. Also clean up docs and tests. - Use native promises over q promises. - Comment out driverProviderLocal tests. If the flag is set, the controlFlow method is undefined and fails this test. The error is as follows: this.driver.controlFlow is not a function at ProtractorBrowser.angularAppRoot
39e02d1
to
e13478b
Compare
… and angularAppRoot - Enabled the driverProviderLocal tests - Remove auto unwrap test for a WebElement. Reference PR angular#3471
e13478b
to
052b591
Compare
return this.driver.controlFlow().execute(() => { | ||
return this.bpClient.setWaitEnabled(!this.internalIgnoreSynchronization); | ||
}); | ||
return this.bpClient.setWaitEnabled(!this.internalIgnoreSynchronization); | ||
} | ||
}) | ||
.then(() => { |
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 promise chain should eventually become async/await, but let's save that for another Pr.
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 agree, this promise chain might be better contained in a separate PR.
7170367
to
e36ebc2
Compare
e36ebc2
to
e52b7d9
Compare
if (timeout) { | ||
let errMsg = `Timed out waiting for asynchronous Angular tasks to finish after ` + | ||
`${timeout}. This may be because the current page is not an Angular ` + | ||
`application. Please see the FAQ for more details: ` + |
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.
Let's do ourselves a favor and extract as much as possible from this if statement into a private function.
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 is a great idea but I think this PR is getting a little out of hand and not keeping on point to what the original description was. I'll write an issue on this for an improvement.
}, this.allScriptsTimeout, 'Plugins.waitForCondition()'); | ||
} catch (err) { | ||
let timeout: RegExpExecArray; | ||
if (/asynchronous script timeout/.test(err.message)) { |
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.
Might as well extract this into a private function to make it more readable.
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.
Same with this.
e52b7d9
to
d729bb7
Compare
- In lieu of Promise.resolve(...) for async await, just return the item - Clean up JSDocs for q.promise - Clean up interactive tests to close the browser window and let Protractor quit the driver session
d729bb7
to
e0bf7c4
Compare
Reference #4995 |
…ngular#5034) Driver providers and tests: - Use native promises over q promises in driver providers - Remove driverProviderUseExistingWebDriver since the generation of the selenium server is already accomplished when providing a selenium address in driverProvider.ts. Also clean up docs and tests. - Enabled the driverProviderLocal tests - Clean up JSDocs for q.promise Basic lib spec: - Remove auto unwrap test for a WebElement. Reference PR angular#3471 Browser: - Remove control flow from waitForAngularEnabled, waitForAngular, and angularAppRoot in the Browser class.
…ngular#5034) Driver providers and tests: - Use native promises over q promises in driver providers - Remove driverProviderUseExistingWebDriver since the generation of the selenium server is already accomplished when providing a selenium address in driverProvider.ts. Also clean up docs and tests. - Enabled the driverProviderLocal tests - Clean up JSDocs for q.promise Basic lib spec: - Remove auto unwrap test for a WebElement. Reference PR angular#3471 Browser: - Remove control flow from waitForAngularEnabled, waitForAngular, and angularAppRoot in the Browser class.