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

Consider adding element filter to base HTML interactor #24

Open
cowboyd opened this issue Aug 30, 2021 · 1 comment
Open

Consider adding element filter to base HTML interactor #24

cowboyd opened this issue Aug 30, 2021 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@cowboyd
Copy link
Member

cowboyd commented Aug 30, 2021

Unlike business app authors, component library authors often need to make assertions on the actual layout a component and how it renders. One way to deal with this is to add custom filters, like clientTop if you need to make an assertion on what the coordinates of the top, you can add a filter.

await component.has(clientTop: 10);

But a filter that nobody should ever use except in the context of the component library itself is of dubious value.

One option is to make element a filter, that way, you can implement custom matchers on it to your heart's content. So instead of having a clientTop filter, you can just have a matcher:

await component.has(element: withClientTop(10));
@cowboyd cowboyd added enhancement New feature or request good first issue Good for newcomers labels Aug 30, 2021
@cowboyd
Copy link
Member Author

cowboyd commented Aug 30, 2021

cherewaty pushed a commit that referenced this issue Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant