Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

fix(types): update for selenium-webdriver types creating transpile errors #3848

Merged
merged 1 commit into from
Dec 20, 2016

Conversation

cnishina
Copy link
Contributor

No description provided.

@cnishina cnishina requested a review from sjelin December 20, 2016 00:29
@cnishina cnishina removed the request for review from sjelin December 20, 2016 00:31
@cnishina
Copy link
Contributor Author

There is a test that leaves a browser session open. Will investigate.

@cnishina
Copy link
Contributor Author

Narrowed down to this test. It passes but the browser is still open: spec/driverProviderLocalConf.js.

We can fix this later.

@cnishina
Copy link
Contributor Author

cnishina commented Dec 20, 2016

Also we are setting a specific version of @types/selenium-webdriver to make sure we don't run into this problem again.

filipesilva added a commit to angular/quickstart that referenced this pull request Dec 20, 2016
When angular/protractor#3848 is ready it should fix the webdriver types issues, and the pinning can be reverted.

The zone.js problem is being tracked on angular/zone.js#554.

Fix #325
filipesilva added a commit to angular/quickstart that referenced this pull request Dec 20, 2016
When angular/protractor#3848 is ready it should fix the webdriver types issues, and the pinning can be reverted.

The zone.js problem is being tracked on angular/zone.js#554.

Fix #325
@@ -4,10 +4,15 @@
* server.
*/
import * as q from 'q';
import {DeferredExecutor, Executor, Session, WebDriver} from 'selenium-webdriver';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DeferredExecutor, Executor, and Session look unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. I had a few issues with mock last night... I'll remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing DeferredExecutor and Executor. The Session constructor is used at getNewDriver.

@juliemr
Copy link
Member

juliemr commented Dec 20, 2016

LGTM!

@cnishina cnishina merged commit 83694f5 into angular:master Dec 20, 2016
Copy link
Contributor

@sjelin sjelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of nits and one important issue in the package.json

@@ -15,7 +15,7 @@
"@types/jasmine": "^2.5.36",
"@types/node": "^6.0.46",
"@types/q": "^0.0.32",
"@types/selenium-webdriver": "~2.53.31",
"@types/selenium-webdriver": "2.53.31",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be "2.53.37". Additionally, we should maybe fix all the other @types in a similar way and put something in release.md about updating types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -562,7 +562,7 @@ export class ProtractorBrowser extends Webdriver {
* @returns {!webdriver.promise.Promise} A promise that will be resolved to an
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: way up on line 13, we have const webdriver = ..., but we only actually use webdriver in the for loop a couple lines later. Let's scope webdriver to that for loop so we don't have two copies of the same library floating around.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scoping the require('selenium-webdriver') in only the for loop

@@ -60,17 +61,15 @@ export class DebugHelper {
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: on line 55, prefer wdpromise

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, on line 42, I think I'd prefer (wdpromise.ControlFlow as any).prototype and get rid of the webdriver variable entirely

Copy link
Contributor Author

@cnishina cnishina Dec 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done and removed require('selenium-webdriver');

@@ -230,9 +229,9 @@ export class DebugHelper {
* is done. The promise will resolve to a boolean which represents whether
* this is the first time that the debugger is called.
*/
private validatePortAvailability_(port: number): webdriver.promise.Promise<any> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: prefer wdpromise

if (this.debuggerValidated_) {
return webdriver.promise.fulfilled(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: prefer wdpromise

@@ -1,6 +1,6 @@
import {By, promise as wdpromise, WebDriver, WebElement} from 'selenium-webdriver';

let webdriver = require('selenium-webdriver');
const webdriver = require('selenium-webdriver');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if you can address my other nit in this file, remove this declaration.

@@ -23,7 +23,7 @@ export class Ptor {
By: ProtractorBy;
by: ProtractorBy;
wrapDriver:
(webdriver: webdriver.WebDriver, baseUrl?: string, rootElement?: string,
(webdriver: WebDriver, baseUrl?: string, rootElement?: string,
untrackOutstandingTimeouts?: boolean) => ProtractorBrowser;
ExpectedConditions: ProtractorExpectedConditions;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: below, for everything under // Export selenium webdriver., prefer the imported version vs the webdriver. version

@@ -23,7 +23,7 @@ export class Ptor {
By: ProtractorBy;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: up on line 11, prefer const webdriver = .... Or possibly just remove the declaration entirely if you can address my other nit in this file

@@ -1,5 +1,6 @@
import {EventEmitter} from 'events';
import * as q from 'q';
import {Session} from 'selenium-webdriver';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add promise as wdpromise to this and replace all the instances of webdriver.promise below with wdpromise

@@ -1,5 +1,6 @@
import {EventEmitter} from 'events';
import * as q from 'q';
import {Session} from 'selenium-webdriver';
import * as util from 'util';

import {ProtractorBrowser} from './browser';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: below on line 17, prefer const webdriver = .... Or, if you can address my other nit from this file, remove the declaration entirely.

jan-molak added a commit to serenity-js/serenity-js that referenced this pull request Dec 26, 2016
talent-programmer pushed a commit to talent-programmer/angular-quickstart that referenced this pull request Nov 30, 2023
When angular/protractor#3848 is ready it should fix the webdriver types issues, and the pinning can be reverted.

The zone.js problem is being tracked on angular/zone.js#554.

Fix angular/quickstart#325
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants