Skip to content

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

Description

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

Activity

  1. mkorpela commented on Mar 24, 2021

    @mkorpela
    ContributorAuthor

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

  2. dgozman commented on Mar 24, 2021

    @dgozman
    Collaborator

    Mikko Korpela (@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.

  3. mkorpela commented on Mar 24, 2021

    @mkorpela
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions