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] Text selector engine normalise whitespaces #3830

Closed
mxschmitt opened this issue Sep 10, 2020 · 0 comments · Fixed by #4312
Closed

[Feature] Text selector engine normalise whitespaces #3830

mxschmitt opened this issue Sep 10, 2020 · 0 comments · Fixed by #4312
Assignees

Comments

@mxschmitt
Copy link
Member

In the web people often use  . If they they want to match the example (see below) with a normal whitespace, it would not work since its a non-breaking whitespace.

// @ts-check
const playwright = require("playwright");

(async () => {
  const browser = await playwright.chromium.launch();
  const page = await browser.newPage();
  await page.setContent(`<button>Sign&nbsp;in</button>`)
  console.log(await page.innerText("text=Sign in"))
  await browser.close();
})();

Proposal: Normalise whitespaces before we compare them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants