Skip to content

Add a .map function #2201

@dv297

Description

@dv297

Are you requesting a feature or reporting a bug?

Feature

What is the current behavior?

N/A

What is the expected behavior?

Generic map function that allows you to map over a Selector. This could be useful with creating assertions that deal with predefined/ expected lists vs actual lists created by the DOM. Since there is already a .filter function, and people always talk about map/filter/reduce being together, this seems like a natural addition to the Selector API.

How would you reproduce the current behavior (if this is a bug)?

N/A

Provide the test code and the tested page URL (if applicable)

Tested page URL:

Test code

Selector('li').map((element) => element.innerText);

Specify your

  • operating system: Windows 10
  • testcafe version: 0.18.1
  • node.js version: 8.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    STATE: StaleAn outdated issue that will be automatically closed by the Stale bot.TYPE: enhancementThe accepted proposal for future implementation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions