-
Notifications
You must be signed in to change notification settings - Fork 672
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
Add the capability to filter elements by their visibility #1018
Comments
These pseduo-selectors are not a part of any CSS spec and implementing them as pseudo-selectors will be quite complicated since we'll need to parse queries. We can introduce filter method instead: Selector('.hey').hidden(true); // default
Selector('.hey').hidden(false); Note that we can't use |
What do you think we should use instead of Is it
|
I think |
|
In most cases we need a visible and accessible element (in viewport and etc.), |
Oh, after reading the user's issue I thought we were going to have two methods with bool parameters like It turns out that we don't. So, we need either two methods with no parameters or one parameterized. Yet I can't choose between |
I don't see logic problem for this (I don't know technical context). DOMNode State has |
@miherlosev Apart from it being a bad design decision for the API:
in https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors.html#dom-node-snapshot (BTW, section that explains selector properties points to the DOM Node snapshot, so it's not quite clear that we expose these properties on Selector as well \cc @VasilyStrelyaev) |
@inikulin The topic that lists the DOM Node State members no longer uses the word And that topic is linked from a section that says about the selector API.
Did I get right what you were asking about? |
@VasilyStrelyaev Yep, maybe it's worth mentioning that they are exposed as promises on Selectors and SelectorPromises, and as regular properties on snapshot in https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/dom-node-state.html |
Looks clear |
Oliver suggested to refactor the entire Selectors topic (#1760) so I'll think of it as a part of this complex task. |
@VasilyStrelyaev And we should deprecate snapshots and SelectorPromises for the love of god. It will significantly simplify both codebase and the API. |
How to click on this pseudo-selector, we have a situation where we have to 'click' on the pseudo selector (which is basically an icon). Any suggestion? |
Currently this is how I am clicking on the element
|
What do you call a From you code, they looks like regular CSS classes, so you would write something like
|
As a temporary workaround for this issue I'm using this module, maybe someone here will find it helpful |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
:hidden Selector - https://api.jquery.com/hidden-selector/
:visible Selector - https://api.jquery.com/visible-selector/
Updated:
Finally we plan to use the following syntax:
The text was updated successfully, but these errors were encountered: