Context:
Code Snippet
Help us help you! Put down a short code snippet that illustrates your bug and
that we can run and debug locally. For example:
const browser = await playwright.chromium.launch({ headless: false})
const context = await browser.newContext({ viewport: null })
const page = await context.newPage()
await page.goto('chrome://downloads')
const element = await page.waitForSelector('.//div', {timeout: 3000})
Describe the bug
It tries to use the css locator strategy instead.
I'm guessing this might be a hard problem to solve given the semantics.

As you can see this is a valid xpath

@Georgegriff Even though we can hot-fix this particular case, the general problem of differentiating between xpath and css is not an easy one and looks like a slippery slope to me. So we'd rather be conservative and stick with a simple-and-clear rule we have today:
only those selectors that start with
//are treated as xpath.
Honestly, it wasn't that easy to find the rules for our selectors in the docs - I've updated docs to have clear references (#2213). Hopefully it'll make life easier.
That's fair, in the framework this came from (CodeceptJS) they have a different heuristic for figuring out xpath so can fix over there rather than here for our user cases thanks for responding
Most helpful comment
@Georgegriff Even though we can hot-fix this particular case, the general problem of differentiating between xpath and css is not an easy one and looks like a slippery slope to me. So we'd rather be conservative and stick with a simple-and-clear rule we have today:
Honestly, it wasn't that easy to find the rules for our selectors in the docs - I've updated docs to have clear references (#2213). Hopefully it'll make life easier.