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

element().query() returns a non-jQuery collection. #3232

Closed
marcfallows opened this issue Jul 15, 2013 · 2 comments
Closed

element().query() returns a non-jQuery collection. #3232

marcfallows opened this issue Jul 15, 2013 · 2 comments

Comments

@marcfallows
Copy link
Member

For the issue which was fixed (#1840), it seems like the commit (ec54712) has introduced a new issue.

If we are using jQuery for the scenario runner:

element(selector).query(function(selectedElements){
  // would expect this to pass
  expect(selectedElements instanceof jQuery).toBeTruthy();
  // but it fails
});

In this case if we use angular.forEach to iterate over the selectedElements it iterates over the length as well.

@marcfallows
Copy link
Member Author

Here's an example, rather than pseudocode, to display the issue:
http://plnkr.co/edit/bjc6jj?p=preview

Since it is not an instance of jQuery, and with recent changes to angular.forEach, iterating over that object would cause unexpected results (it would also iterate over the length property).

@btford
Copy link
Contributor

btford commented Jul 23, 2014

Thanks for filing this, but Scenario Runner is now deprecated in favor of protractor, so I'm going to close this.

@btford btford closed this as completed Jul 23, 2014
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