Skip to content
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

Add definitions for angular-protractor 1.0.0-rc4 #2513

Merged
merged 2 commits into from Jul 19, 2014
Merged

Add definitions for angular-protractor 1.0.0-rc4 #2513

merged 2 commits into from Jul 19, 2014

Conversation

sibnerian
Copy link

I've been working on a Typescript project that uses Angular/Protractor, so I've changed the definitions to match the latest Protractor version! There were a lot of API changes for the first major release, so this should make things a lot easier for Angular devs working with the library.

@basarat
Copy link
Member

basarat commented Jul 16, 2014

@BillArmstrong would love you opinion on this please

@BillArmstrong
Copy link
Contributor

I've reviewed the changes and they look good with these exceptions:

  1. The functions in the Element interface had optional parameters added to them. Unless I'm missing something, these optional parameters are only available on the internal constructor for ElementFinder. They are not available on the publicly available wrapper around the constructor. The optional parameters should not have been added.
  2. The isElementPresent function on the ElementFinder interface should only have one parameter. This function is explicitly defined in ElementFinder and replaces the version on the wrapped WebElement class. NOTE that my original version also has multiple parameters for this function, but this may have changed in the latest version of Protractor.
  3. The ElementArrayFinder interface is missing these two methods: "asElementFinders_" and "then".

Bill

@basarat
Copy link
Member

basarat commented Jul 17, 2014

@isibner can you review Bill's comments please. Thanks.

* Remove optional parameters from Element interface
* Remove additional parameters from ElementFinder.isElementPresent
* Add "asElementFinders_" and "then" methods to ElementArrayFinder interface
@sibnerian
Copy link
Author

Sorry, I wasn't able to get to this yesterday! @BillArmstrong, thanks for the feedback - I've taken another look and your concerns were correct. The new commit should have fixes for everything you noted.

@basarat
Copy link
Member

basarat commented Jul 19, 2014

The new commit should have fixes for everything you noted.

Yup. Thanks @isibner / @BillArmstrong !

basarat added a commit that referenced this pull request Jul 19, 2014
Add definitions for angular-protractor 1.0.0-rc4
@basarat basarat merged commit 5326ecd into DefinitelyTyped:master Jul 19, 2014
@yngvark
Copy link

yngvark commented Jul 21, 2014

I just pulled this (using "tsd query angular-protractor -a install"), and VisualStudio now gives me the following error: "Error 340 Subsequent variable declarations must have the same type. Variable '$' must be of type 'cssSelectorHelper', but here has type 'JQueryStatic'. [x]\Scripts\typings\jquery\jquery.d.ts 3936
"

I believe this is because I have included both jquery.d.ts and angular-protractor.d.ts in the same Visual Studio project, both of which declares the global variable "$". From Angular-protracor.d.ts
"
declare var $: cssSelectorHelper;
"

If I'm not doing something wrong, this has to be a serious problem I believe?

@basarat
Copy link
Member

basarat commented Jul 21, 2014

this has to be a serious problem I believe?

Possibly. The definitions are correct though. Protractor's $ isn't jQuery : http://stackoverflow.com/a/22854397/390330

doing something wrong

Don't use protractor and jQuery defs in the same project. More like a question for Visual Studio team.

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

Successfully merging this pull request may close these issues.

None yet

4 participants