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] Statically parse selectors before executing tests #13332

Closed
IanVS opened this issue Apr 5, 2022 · 5 comments
Closed

[Feature] Statically parse selectors before executing tests #13332

IanVS opened this issue Apr 5, 2022 · 5 comments

Comments

@IanVS
Copy link

IanVS commented Apr 5, 2022

This is just an idea, but I found that sometimes I have a small typo in a selector, and it doesn't error until playwright actually tries to execute it, then I get a parse error. It might be nice to perform a static analysis of the selectors up-front, to fail fast. This might not always be possible (e.g. if the selectors aren't just string literals), but it might be useful at least as a "best effort" attempt.

@mxschmitt
Copy link
Member

mxschmitt commented Apr 6, 2022

Could you share with us what kind of typos you mean? Might be something for the ESLint plugin (#9474) or for the VSCode extension.

@enricopolanski
Copy link

I guess something malformed as locator(foo[bar=baz).

@IanVS
Copy link
Author

IanVS commented Apr 7, 2022

Exactly. I think I had an extra ] somewhere.

@mxschmitt
Copy link
Member

Folding into #16972

@IanVS
Copy link
Author

IanVS commented Apr 7, 2022

I think there could be value to others who do not use vscode if this were done at the very start of the test run itself, but I do use vscode, so I won't complain. :).

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

3 participants