Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Update to selenium 3.x #12

Merged
merged 9 commits into from
Jul 6, 2018
Merged

Conversation

NickTomlin
Copy link
Contributor

This is a very much breaking change to bring webdriver-js-extender inline with the switch to selenium 3.x. This isn response to angular/protractor#4148 and related to the work in angular/protractor#4158.

I understand what this library is doing at a very high level, but I'm a bit lost when it comes to some of the internals. I took a semi heavy-handed approach in ripping all the 2.x functionality out; let me know if that is not a good thing to do.

Assumptions:

  • We no longer need to support node <6 so a TS target of es6 is fine
  • We no longer need to support selenium < 3.x so ripping out patch and deferred_executor is fine
  • Changing the table tests to expect an object like { sessionId: 'f724cfd8-419d-4c74-82dc-adf8f43335cd', status: 0 } where we once received null is fine (I'm the least confident about this)

This is more of a conversation starter than a sure thing so please educate me if there's something obvious I'm missing. 😄

@monkpit
Copy link

monkpit commented Jan 29, 2018

I am running into issues in Protractor - the root cause is that Protractor is using a combination of Selenium v2 and v3. I am having to explicitly cast objects to any in my TypeScript files to get things to compile, because of the mismatch between the v2 and v3 APIs.

@sjelin is there anything I can do to help get this merged?

@andreasmarkussen
Copy link

@qiyigg - @gkalpak
Could you comment on the above? :) Share some love on a component that is used by the latest version of Protractor, and is causing an annoying warning, and using very old versions of selenium. (2.5.x)

@gkalpak
Copy link
Member

gkalpak commented Feb 22, 2018

I am not really involved with protractor. @qiyigg probably knows more :)

@qiyigg
Copy link
Contributor

qiyigg commented Mar 6, 2018

Sorry, I don't know much about webdriver-js-extender. Probably I can get some time to take a look at it this week, sorry for late response.

@@ -1,5 +1,5 @@
import * as webdriver from 'selenium-webdriver';
import {extend, patch} from '../lib';
import {extend} from '../lib';
import {DeferredExecutor} from '../lib/deferred_executor';
Copy link
Contributor

Choose a reason for hiding this comment

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

This can also be removed


if (testcase.result != null) {
expect(result).toEqual(testcase.result);
} else if (result != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a scenario/possibility that the "testcase.result" is null, but "result" is not null. It seems the test can still pass without these changes.

Copy link
Contributor Author

@NickTomlin NickTomlin Jul 2, 2018

Choose a reason for hiding this comment

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

I believe this failed because of tslint but i'd be 👍 on restoring the original line. Let me investigate that

@qiyigg
Copy link
Contributor

qiyigg commented May 14, 2018

The PR looks good to me in general, but I am not familiar with webdriver-js-extender. It would be better if any of you(@sjelin @juliemr @vikerman or who else might know this) could also take a look at it since it is a breaking change which will break all the tests based on webdriver-js-extender which tries to patch the required lib by themselves. (Since we have a common lib to do this: initMockSeleniumStandaloneServerAndGetDriverFactory, it's probably not that bad)

I'll leave this PR for a while and merge it if no response was got.

@NickTomlin
Copy link
Contributor Author

NickTomlin commented May 17, 2018

@qiyigg thanks for the review!

I am going out of town but I will make the edits you've suggested early next week. I haven't been involved in this project as of late, so i'm also on very shaky ground here. If we can't get feedback from folks who know more perhaps we could get some volunteers to beta test these changes?

@qiyigg
Copy link
Contributor

qiyigg commented May 18, 2018

@NickTomlin Thanks, Nick. If you know who might be volunteers, it would be great. I don't even know who is using it.

@qiyigg
Copy link
Contributor

qiyigg commented Jun 11, 2018

@NickTomlin Hi, Nick, do you have some time to take a look at those comments?
I just double checked the Protractor code, Protractor has already extended its webdriver with webdriver-js-extender.
Therefore,

  1. In general, Protractor user won't interact with webdriver-js-extender directly, as long as we make Protractor compatible with new webdriver-js-extender(I think this should just work), user's test should just work.

  2. For user who does not use webdriver-js-extender through Protractor, they can choose either fixing their tests(if they use the common helper provided by webdriver-js-extender, it should just work) or sticking with the old version if they don't want to change their code.

I think it is ok to merge this change.

@rajarshi-singh
Copy link

I have created a new PR and replicated changes here #20

@marcalj
Copy link

marcalj commented Jun 29, 2018

Guys, can you merge this to solve the malicious version package issue? Thanks! :)

@NickTomlin
Copy link
Contributor Author

@qiyigg thanks! I finally got around to resolving your comments. I also included a node engine bump to match protractor core. Let me know if that's something you want split out into another PR.

@qiyigg
Copy link
Contributor

qiyigg commented Jul 6, 2018

Looks good to me, merged. I will make a new release of this and Protractor next week.
Thanks a lot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants