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

protractor.Key.chord() not transpiling #3879

Closed
pittgoose opened this issue Dec 26, 2016 · 2 comments
Closed

protractor.Key.chord() not transpiling #3879

pittgoose opened this issue Dec 26, 2016 · 2 comments

Comments

@pittgoose
Copy link
Contributor

I just upgraded to protractor 4.0.14 and I'm getting a Typescript compiler error on the following code:
browser.actions().sendKeys(protractor.Key.chord(protractor.Key.CONTROL, "a")).perform();
error:
Error:(47, 55) TS2339:Property 'chord' does not exist on type 'IKey'.
I know that 4.0.14 addressed transpiling issues with webdriver. Not sure if this could've broken it.

Any help here would be greatly appreciated.

Node: 6.9.1
OS: Windows 10

@cnishina
Copy link
Member

If you are using the @types/selenium-webdriver that comes with 4.0.14, it is because chord method does not exist in the typings. This has been fixed with DefinitelyTyped/DefinitelyTyped#13513. The fix should be in the latest version 2.53.38.

Option 1. Set protractor.Key to any:

browser.actions().sendKeys((protractor.Key as any).chord(protractor.Key.Control, "a")).perform();

We just set protractor.Key to any so the chord method will just work.

Option 2. May or may not work (needs investigation):

Install the latest version of @types/selenium-webdriver: 2.53.38+. I am not what happens with different installed version of @types/selenium-webdriver.

@cnishina
Copy link
Member

Verified: Use option 2 and install a newer version of @types/selenium-webdriver. This appears to override the installed types by Protractor.

Closing this issue since the last item for investigation has been answered.

cnishina pushed a commit that referenced this issue Dec 28, 2016
Fixes issue #3879 and adds the protractor.Key.chord method
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

2 participants