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 :eq(NUMBER) pseudoselector #26

Closed
cibernox opened this issue Mar 2, 2017 · 1 comment
Closed

Support :eq(NUMBER) pseudoselector #26

cibernox opened this issue Mar 2, 2017 · 1 comment

Comments

@cibernox
Copy link
Owner

cibernox commented Mar 2, 2017

Another pseudoselector in jQuery that is pretty useful is the :eq(N). It returns the Nth occurence of a selector in the dom.

For some usages like assert.equal($('.user:eq(2)').text().trim(), 'James') it can be easily replaced by assert.equal(findAll('.user')[2].textContent.trim(), 'James').

However, this doesn't work for selectors like click('.profile-link:eq(2)').

An scape valve would be to allow helpers to receive HTMLElements instead of selectors, and do click(findAll('.profile-link')[0]).
That is my next issue.

@cibernox
Copy link
Owner Author

cibernox commented Mar 4, 2017

Superseded by #32

@cibernox cibernox closed this as completed Mar 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant