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

Protractor 5.1.1 selenium-webdriver @types version inconsitency #4148

Open
CAL-RJ opened this issue Mar 13, 2017 · 6 comments
Open

Protractor 5.1.1 selenium-webdriver @types version inconsitency #4148

CAL-RJ opened this issue Mar 13, 2017 · 6 comments
Assignees

Comments

@CAL-RJ
Copy link

CAL-RJ commented Mar 13, 2017

Bug report

  • Node Version: 6.9.4
  • Protractor Version: 5.1.1
  • Angular Version: 2.4.8
  • Browser(s): n/a
  • Operating System and Version Windows 7

I've recently upgraded to Protractor 5.1.1 and am facing some issues when setting cookies via browser.manage().addCookie()

The API has changed between versions 2 and 3 of Selenium-webdriver to expect an object rather than the previous 2..6 arguments. When I make the changes to my code to use the object, the typescript compiler complains saying that it expects 2..6 arguments.

old api:

browser.manage().addCookie('cookieName', 'cookieVal');

new api:

browser.manage().addCookie({name:'cookieName', value: 'cookieVal'});

I think this is because the @types/selenium-webdriver in the package.json of protractor v5.1.1 is pointing at version 2.53.39. The version of the actual selenium-webdriver the same package.json is referencing is 3.0.1.

I think they should both be version 3.*

related stack overflow question

@NickTomlin
Copy link
Contributor

Thanks for raising this! This is something that we will need to take care of internally.

The current workaround in Craig's SO answer:

(browser.manage() as any).addCookie({name:'cookieName', value: 'cookieVal'});

I can pick this up later in the week unless someone has time to work on it before then.

@cnishina
Copy link
Member

This should be updated. @NickTomlin do a search for // TODO's. We have a few places that we hacked in the as any to get Protractor's lib to transpile.

@NickTomlin
Copy link
Contributor

NickTomlin commented Mar 17, 2017

@cnishina it looks like webdriver-extender is the underlying issue here since the types point to selenium 2.x. I'm still seeing the error in this issue when consuming a version of Protractor with the types at 3.x

I was able to resolve some todos in #4158 but there's still a mismatch for addCookie. I'll do some digging in web driver extender to try and update there as well but the code is pretty opaque to me at the moment 😄 Any tips would be very much appreciated

@soad666p
Copy link

any update on this, as i still see a problem with adding the cookie and get cookie

@whyboris
Copy link

November 27th, problem persists with "protractor": "5.2.0"

@monkpit
Copy link
Contributor

monkpit commented Jan 29, 2018

This is still a problem in 2018 - there was some work done by @NickTomlin here but there has been no response to the PR.

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

No branches or pull requests

6 participants