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

Add elementArrayFinder.some #625

Closed
mohsen1 opened this issue Mar 19, 2014 · 2 comments
Closed

Add elementArrayFinder.some #625

mohsen1 opened this issue Mar 19, 2014 · 2 comments

Comments

@mohsen1
Copy link

mohsen1 commented Mar 19, 2014

Following my question here at StackOverflow I think elementArrayFinder.som can be handy for solving my issue there.

elementArrayFinder.some = function(fn) {
      return using().findElements(locator).then(function(arr) {
        return arr.some(function(webElem) {
          fn(webElem);
        });
      });
    };

With that, I can write:

      var isShown = helpers.getRoleRows().some(function(row){
        return row.getText().indexOf(ROLE_NAME) > -1
      });
      expect(isShown).toBe(true);

Should I work on a PR for this?

@juliemr
Copy link
Member

juliemr commented Mar 20, 2014

Sure, this looks good!

@hankduan
Copy link
Contributor

subset of #877. Closing this as duplicate

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

Successfully merging a pull request may close this issue.

3 participants