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

[BUG] PW 1.9.2 backwards incompatible text selector change #5943

Closed
mkorpela opened this issue Mar 24, 2021 · 3 comments
Closed

[BUG] PW 1.9.2 backwards incompatible text selector change #5943

mkorpela opened this issue Mar 24, 2021 · 3 comments

Comments

@mkorpela
Copy link
Contributor

mkorpela commented Mar 24, 2021

Context:

text selector with quotes did a change to be case-sensitive. Freeking day debugging this for my dear colleague but he managed to debug that it was because of 1.9.2 lost ability to detect text over multiple html elements.

Like: text="Work" figuring this out with 1.9.1 and not with 1.9.2

<span class="js-animated-title">
<span class="animate-up js">Wo</span>
<span class="animate-down js">rk</span>
</span>
  • Playwright Version: 1.9.2
  • Operating System: Linux and Mac .. I'm not starting your masters system so lets leave this here.
  • Node.js version: 14.15.5
  • Browser: Chromium at least

Code Snippet

I put this to our issues too MarketSquare/robotframework-browser#859
I'll pseudocode it here:

const { chromium } = require('playwright');
(async () => {
  const browser = chromium.launch();
  const page = browser.newPage();
  await page.goto("https://www.reaktor.com");
  await page.click('text="Work"');
})();

Works with 1.9.1 and not with 1.9.2

@mkorpela
Copy link
Contributor Author

My colleague was pointing to this PR #5766 as a potential culprit.

@dgozman
Copy link
Contributor

dgozman commented Mar 24, 2021

@mkorpela Sorry for the inconvenience, there was indeed some hiatus about text selector in v1.9.

  • In 1.9.1 we had a change in the text selector that was breaking in some edge cases.
  • In 1.9.2 we decided to revert back to the original behavior to avoid unexpected behavior.

Unfortunately, if you have picked up 1.9.1 and used text selectors that relied on that incompatible behavior, 1.9.2 was breaking. We are sorry about this! We assume that only some small percent of users should be affected, and unluckily that was the case for you.

Going forward, this should not happen again. The behavior from 1.9.2 will be continued in 1.10 and future releases.

@dgozman dgozman closed this as completed Mar 24, 2021
@mkorpela
Copy link
Contributor Author

Sorry that you feel that this is ok solution.
Now there is no short exact visual text match when using html elements like span or a in a text.
Only way I can think of is now using regex text matcher.

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

No branches or pull requests

2 participants