Skip to content

[💡 Feature]: Support .entries() for ChainablePromiseArray #13954

@P-Courteille

Description

@P-Courteille

Is your feature request related to a problem?

Related to #13943

For now, it's not possible to access loop index from a "for...of loop" with the following example:

for await (const [index, element] of await browser.$$('a').entries()) {
console.log(await element.getText())
}

Because:

  • ".entries()" doesn't exist for an ChainablePromiseArray
  • Without the ".entries()" the type is in a error because element doesn't have method 'Symbol.iterator'

Describe the solution you'd like.

The iterator/index of the loop is available

Describe alternatives you've considered.

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

Idea 💡A new feature ideahelp wantedIssues that are free to take by anyone interested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions