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

docs: clarify that locator.nth is zero based #7326

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

patak-dev
Copy link
Member

Description

Add a note as Playwright has in their docs for nth.

I think that nth() should start from 1, in the same way that CSS :nth-child and usage in JS like nthCalledWith. I thought of adding an at() alias to avoid confusion, but I think aligning with playwright locators is more important here. Maybe the alias could first be proposed to Playwright, but I doubt they will be willing to change this.

Copy link

netlify bot commented Jan 21, 2025

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit e88a522
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/678f9b2b8e8b3600085e87a1
😎 Deploy Preview https://deploy-preview-7326--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sheremet-va
Copy link
Member

Maybe the alias could first be proposed to Playwright, but I doubt they will be willing to change this.

We don't depend on Playwright, we can build our own locators.

@sheremet-va sheremet-va merged commit 9745fe8 into main Jan 21, 2025
8 checks passed
@sheremet-va sheremet-va deleted the docs/clarify-locator-nth-is-zero-based branch January 21, 2025 13:52
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

Successfully merging this pull request may close these issues.

2 participants