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

[Feature] Removal of .$ functions #2055

Closed
thernstig opened this issue Apr 30, 2020 · 2 comments
Closed

[Feature] Removal of .$ functions #2055

thernstig opened this issue Apr 30, 2020 · 2 comments

Comments

@thernstig
Copy link
Contributor

I've always found the page.$, page.$$ (and their eval and frame etc. counterparts) weird as function names. Mainly for the fact that $ really is no English word giving any information as to what they do. I believe this might come from jQuery, but I have no idea why Playwright would need to follow that style.

Now that e.g. page.waitForSelector() exists, is there e.g. any need at all for page.$? I realize there is no equivalent for page.$$ (and maybe the evals, although element.innerHtml() etc. now exists that can be done outside of an eval.)

@pavelfeldman
Copy link
Member

Your suggestion makes total sense, but it is too late for us to back from the beloved $. It does not wait for selector by the way, so if you know element it there, that's the fastest way of getting a hold of a handle...

@thernstig
Copy link
Contributor Author

My reasoning was that since you are in beta, there wasn't any "too lates" yet 😄

Would adding documentation to the .$ and .$$ at least be good to mention they do not wait for selectors? Since most users will end up using the direct action commands and waitForSelector() (guessing here) - I'd say some users who never used Playwright (nor Puppeteer) would know the difference between e.g. page.$() and page.waitForSelector() by just reading the docs (if they are lucky they can guess).

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

2 participants