query() takes one string and auto-detects the engine: a plain string runs as a CSS selector, one starting with /, ./ or (/ runs as XPath. Type a selector into the argument and the matches light up.
await tab.query("") ·
quotes.html

"Stay hungry, stay foolish."

Jobslifework

"Less is more."

Rohedesign
Leading /, ./ or (/ → XPath. Anything else → CSS. It runs the same querySelectorAll / XPath the browser does, so what matches here matches in your automation.