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

chore: better error message when CSS selector fails to parse #34331

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Jan 15, 2025

This updates error messages to:

  • always mention "css selector";
  • suggest using CSS.escape to fix it.

Unfortunately, we cannot suggest a fixed selector by applying CSS.escape(brokenToken) without updating third-party tokenizer, because things like .8abc are recognized as DimensionToken instead of DelimToken + something.

References #34320.

This updates error messages to:
- always mention "css selector";
- suggest using `CSS.escape` to fix it.

Unfortunately, we cannot suggest a fixed selector by applying
`CSS.escape(brokenToken)` without updating third-party tokenizer,
because things like `.8abc` are recognized as `DimensionToken`
instead of `DelimToken` + something.
@dgozman dgozman requested a review from yury-s January 15, 2025 11:11
Copy link
Contributor

Test results for "tests 1"

8 flaky ⚠️ [firefox-page] › tests/page/page-evaluate.spec.ts:403:3 › should throw for too deep reference chain @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › tests/ui-mode-test-update.spec.ts:83:5 › should pick new / deleted tests @ubuntu-latest-node20-1
⚠️ [webkit-library] › tests/library/browsertype-launch.spec.ts:22:3 › should reject all promises when browser is closed @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › tests/library/proxy.spec.ts:93:11 › should proxy local network requests › by default › localhost @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › tests/library/selector-generator.spec.ts:564:5 › selector generator › should generate multiple: noText in role @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › tests/library/trace-viewer.spec.ts:149:1 › should open simple trace viewer @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › tests/page/page-set-input-files.spec.ts:147:3 › should upload large file @webkit-ubuntu-22.04-node18
⚠️ [playwright-test] › tests/ui-mode-test-watch.spec.ts:254:5 › should queue watches @windows-latest-node18-1

37590 passed, 648 skipped
✔️✔️✔️

Merge workflow run.

@yury-s yury-s merged commit 4d55d30 into microsoft:main Jan 15, 2025
29 checks passed
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