playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Bug]: In Expect Assertion ignoreCase option not working for toHaveText()

Open shashankkvs309668 opened this issue 7 months ago • 1 comments

Version

1.52

Steps to reproduce

  1. Have Below Type Assertion if(dbData.ADDRESS) await expect.soft(<MY_SELECTOR>.nth(0)).toHaveText((dbData.ADDRESS),{useInnerText:true,ignoreCase:true})

Expected behavior

Expect to Ignore case in the sentence. The Below Expected and Actual should be passed Expected string: "15951 SW 41ST ST" Received string: "15951 Sw 41st St"

Actual behavior

Throwing an Error

Expected string: "15951 SW 41ST ST" Received string: "15951 Sw 41st St"

Additional context

Please Confirm If this is the actual behavior

Environment

System:
OS: Windows 10

Browser For Testing: Chrome

Binaries:
Node:v18.20.8
npm:10.8.2

Playwright Version:1.52

shashankkvs309668 avatar Jun 10 '25 15:06 shashankkvs309668

@shashankkvs309668 ignoreCase should indeed ignore the difference between "41ST" and "41st". That said, we need a full self-contained repro to be able to fix the issue. Could you please share the repro with us? Take a look at this guide for helpful tips.

dgozman avatar Jun 11 '25 08:06 dgozman

Closing because we lack the information to act on this issue. If you can provide a full repro, please file a new issue by filling the "Bug Report" template, and link to this one.

dgozman avatar Jun 16 '25 08:06 dgozman