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

Support Hierarchical CSS Selectors #390

Open
diba1013 opened this issue Oct 24, 2019 · 0 comments
Open

Support Hierarchical CSS Selectors #390

diba1013 opened this issue Oct 24, 2019 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@diba1013
Copy link

diba1013 commented Oct 24, 2019

Problem

When we encounter missing elements with the Unbreakable Selenium, we try to find the old element inside the golden master. Therefore, we query the By used and look what type was used (i.e. By.id, By.class).

However, when we try to find By.cssSelector, we currently only support simple css selectors. The supported selectors look for some known attributes like id or class. For example:

  • By.cssSelector( "#id" );
  • By.cssSelector( ".class" );

This should be the same for @FindBy.

Solution

We want to support hierarchical selectors. Note, that this issue should only address selectors that query the parent or its' children of the current element. It should not look for attributes on the current element. A complete specification of CSS selectors can be found in the CSS specification.

The current element would mean to selects any element (this also includes any * or no selector) and queries parent, children, state : or pseudo-element ::. Note that the state may only look at the elements' parent or children. Please refer to the examples below. Note that those examples are not complete, refer to the specification for more.

Examples this issue should address

  • div p
  • div > p
  • p~ul
  • p::before
  • p:nth-child(4)

Examples not considered for this issue (see #389)

  • a[target]
  • a[target=_blank
  • input:checked

Community

I kindly ask the community to provide examples below that should be reflected with this issue, so that we can use these to test the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

1 participant