Skip to content

fix: java style selector string - #36227

Merged
Dmitry Gozman (dgozman) merged 2 commits into
microsoft:mainfrom
Skn0tt:fix-java-selectors
Jun 6, 2025
Merged

fix: java style selector string#36227
Dmitry Gozman (dgozman) merged 2 commits into
microsoft:mainfrom
Skn0tt:fix-java-selectors

Conversation

@Skn0tt

Copy link
Copy Markdown
Member

In Java and DotNet, we don't document wrapping parantheses: https://playwright.dev/java/docs/api/class-selectors#selectors-register

Without them, we throw an error though since 3371fb9:

Error: page.textContent: SyntaxError: Unexpected token '{'
        at eval (<anonymous>)
        at InjectedScript.eval (<anonymous>:6418:24)
        at new InjectedScript (<anonymous>:6408:36)
        at <anonymous>:7741:16
        at <anonymous>:7742:11
    Call log:
      - waiting for locator('textContent=div')

        at InjectedScript.eval (<anonymous>:6418:24)
        at InjectedScript (<anonymous>:6408:36)
        at <anonymous>:7741:16
        at <anonymous>:7742:11
        at /Users/skn0tt/dev/microsoft/playwright/tests/page/selectors-register.spec.ts:143:14
        at InjectedScript.eval (<anonymous>:6418:24)
        at InjectedScript (<anonymous>:6408:36)
        at <anonymous>:7741:16
        at <anonymous>:7742:11
        at InjectedScript.eval (<anonymous>:6418:24)
        at InjectedScript (<anonymous>:6408:36)
        at <anonymous>:7741:16
        at <anonymous>:7742:11

@github-actions

This comment has been minimized.

Comment thread tests/page/selectors-register.spec.ts Outdated
Comment thread tests/page/selectors-register.spec.ts Outdated
Signed-off-by: Dmitry Gozman <dgozman@gmail.com>
@github-actions

github-actions Bot commented Jun 6, 2025

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

3 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:986:7 › cli codegen › should not throw csp directive violation errors @firefox-ubuntu-22.04-node18
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:104:3 › should work with strict CSP policy @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

39327 passed, 818 skipped
✔️✔️✔️

Merge workflow run.

@dgozman
Dmitry Gozman (dgozman) merged commit 34c2954 into microsoft:main Jun 6, 2025
Dmitry Gozman (dgozman) added a commit that referenced this pull request Jun 6, 2025
Signed-off-by: Dmitry Gozman <dgozman@gmail.com>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
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